Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
5b4e36cd
Commit
5b4e36cd
authored
Jun 22, 2013
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only show app's traffic stats
parent
04c10d4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/main/scala/com/github/shadowsocks/ShadowsocksService.scala
...ain/scala/com/github/shadowsocks/ShadowsocksService.scala
+4
-4
No files found.
src/main/scala/com/github/shadowsocks/ShadowsocksService.scala
View file @
5b4e36cd
...
@@ -119,8 +119,8 @@ class ShadowsocksService extends Service {
...
@@ -119,8 +119,8 @@ class ShadowsocksService extends Service {
private
var
mStopForegroundArgs
=
new
Array
[
AnyRef
](
1
)
private
var
mStopForegroundArgs
=
new
Array
[
AnyRef
](
1
)
private
var
state
=
State
.
INIT
private
var
state
=
State
.
INIT
private
var
last
=
new
TrafficStat
(
TrafficStats
.
get
TotalTxBytes
,
private
var
last
=
new
TrafficStat
(
TrafficStats
.
get
UidTxBytes
(
getApplicationInfo
.
uid
)
,
TrafficStats
.
get
TotalRxBytes
,
java
.
lang
.
System
.
currentTimeMillis
())
TrafficStats
.
get
UidRxBytes
(
getApplicationInfo
.
uid
)
,
java
.
lang
.
System
.
currentTimeMillis
())
private
var
lastTxRate
=
0
private
var
lastTxRate
=
0
private
var
lastRxRate
=
0
private
var
lastRxRate
=
0
private
val
timer
=
new
Timer
(
true
)
private
val
timer
=
new
Timer
(
true
)
...
@@ -408,8 +408,8 @@ class ShadowsocksService extends Service {
...
@@ -408,8 +408,8 @@ class ShadowsocksService extends Service {
// initialize timer
// initialize timer
val
task
=
new
TimerTask
{
val
task
=
new
TimerTask
{
def
run
()
{
def
run
()
{
val
now
=
new
TrafficStat
(
TrafficStats
.
get
TotalTxBytes
,
val
now
=
new
TrafficStat
(
TrafficStats
.
get
UidTxBytes
(
getApplicationInfo
.
uid
)
,
TrafficStats
.
get
TotalRxBytes
,
java
.
lang
.
System
.
currentTimeMillis
())
TrafficStats
.
get
UidRxBytes
(
getApplicationInfo
.
uid
)
,
java
.
lang
.
System
.
currentTimeMillis
())
val
txRate
=
((
now
.
tx
-
last
.
tx
)
/
1024
/
TIMER_INTERVAL
).
toInt
val
txRate
=
((
now
.
tx
-
last
.
tx
)
/
1024
/
TIMER_INTERVAL
).
toInt
val
rxRate
=
((
now
.
rx
-
last
.
rx
)
/
1024
/
TIMER_INTERVAL
).
toInt
val
rxRate
=
((
now
.
rx
-
last
.
rx
)
/
1024
/
TIMER_INTERVAL
).
toInt
last
=
now
last
=
now
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment