mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
The maxrss reported by getrusage is in kilobytes, not pages
This commit is contained in:
parent
d23bc77e2c
commit
9e4dacd5e7
@ -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():
|
|||||||
# 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")
|
|||||||
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)
|
||||||
|
|
||||||
# pages
|
# kilobytes
|
||||||
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",
|
||||||
|
Loading…
Reference in New Issue
Block a user