Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
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
Maunium
synapse
Commits
9e4dacd5
Commit
9e4dacd5
authored
9 years ago
by
Mark Haines
Browse files
Options
Downloads
Patches
Plain Diff
The maxrss reported by getrusage is in kilobytes, not pages
parent
d23bc77e
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
synapse/metrics/__init__.py
+3
-4
3 additions, 4 deletions
synapse/metrics/__init__.py
with
3 additions
and
4 deletions
synapse/metrics/__init__.py
+
3
−
4
View file @
9e4dacd5
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
from
__future__
import
absolute_import
from
__future__
import
absolute_import
import
logging
import
logging
from
resource
import
getrusage
,
getpagesize
,
RUSAGE_SELF
from
resource
import
getrusage
,
RUSAGE_SELF
import
functools
import
functools
import
os
import
os
import
stat
import
stat
...
@@ -100,7 +100,6 @@ def render_all():
...
@@ -100,7 +100,6 @@ def render_all():
# process resource usage
# process resource usage
rusage
=
None
rusage
=
None
PAGE_SIZE
=
getpagesize
()
def
update_resource_metrics
():
def
update_resource_metrics
():
...
@@ -113,8 +112,8 @@ resource_metrics = get_metrics_for("process.resource")
...
@@ -113,8 +112,8 @@ resource_metrics = get_metrics_for("process.resource")
resource_metrics
.
register_callback
(
"
utime
"
,
lambda
:
rusage
.
ru_utime
*
1000
)
resource_metrics
.
register_callback
(
"
utime
"
,
lambda
:
rusage
.
ru_utime
*
1000
)
resource_metrics
.
register_callback
(
"
stime
"
,
lambda
:
rusage
.
ru_stime
*
1000
)
resource_metrics
.
register_callback
(
"
stime
"
,
lambda
:
rusage
.
ru_stime
*
1000
)
#
pag
es
#
kilobyt
es
resource_metrics
.
register_callback
(
"
maxrss
"
,
lambda
:
rusage
.
ru_maxrss
*
PAGE_SIZE
)
resource_metrics
.
register_callback
(
"
maxrss
"
,
lambda
:
rusage
.
ru_maxrss
*
1024
)
TYPES
=
{
TYPES
=
{
stat
.
S_IFSOCK
:
"
SOCK
"
,
stat
.
S_IFSOCK
:
"
SOCK
"
,
...
...
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