Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mullvad Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Mullvad Browser
Commits
5bcd7c4a
Commit
5bcd7c4a
authored
16 years ago
by
anodelman@mozilla.com
Browse files
Options
Downloads
Patches
Plain Diff
Bug 419776 - talos should measure x resources p=dougt r=anodelman
parent
7ebcfa53
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testing/performance/talos/cmanager_linux.py
+15
-1
15 additions, 1 deletion
testing/performance/talos/cmanager_linux.py
with
15 additions
and
1 deletion
testing/performance/talos/cmanager_linux.py
+
15
−
1
View file @
5bcd7c4a
...
...
@@ -49,7 +49,8 @@
__author__
=
'
annie.sullivan@gmail.com (Annie Sullivan)
'
import
subprocess
import
sys
import
os
import
time
import
threading
...
...
@@ -98,10 +99,23 @@ def GetCpuTime(pid, sampleTime=1):
# return all zeros on this platform as per the 7/18/07 perf meeting
return
0
def
GetXRes
(
pid
):
"""
Returns the total bytes used by X
"""
try
:
cmdline
=
"
xrestop -m 1 -b | grep -A 15
"
+
str
(
pid
)
+
"
| tr -d
\"\n\"
| sed
\"
s/.*total bytes.*: ~//g
\"
"
pipe
=
subprocess
.
Popen
(
cmdline
,
shell
=
True
,
stdout
=-
1
).
stdout
data
=
pipe
.
read
()
pipe
.
close
()
return
data
except
:
print
"
Unexpected error:
"
,
sys
.
exc_info
()
return
-
1
counterDict
=
{}
counterDict
[
"
Private Bytes
"
]
=
GetPrivateBytes
counterDict
[
"
RSS
"
]
=
GetResidentSize
counterDict
[
"
% Processor Time
"
]
=
GetCpuTime
counterDict
[
"
XRes
"
]
=
GetXRes
class
CounterManager
(
threading
.
Thread
):
"""
This class manages the monitoring of a process with any number of
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment