mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-13 06:20:42 -05:00
Add standard process_*_memory_bytes metrics
This commit is contained in:
parent
9b0316c75a
commit
95fc70216d
1 changed files with 8 additions and 0 deletions
|
|
@ -113,6 +113,7 @@ def render_all():
|
||||||
# process resource usage
|
# process resource usage
|
||||||
|
|
||||||
TICKS_PER_SEC = 100
|
TICKS_PER_SEC = 100
|
||||||
|
BYTES_PER_PAGE = 4096
|
||||||
|
|
||||||
rusage = None
|
rusage = None
|
||||||
stats = None
|
stats = None
|
||||||
|
|
@ -188,6 +189,13 @@ process_metrics.register_callback(
|
||||||
"cpu_seconds_total", lambda: (float(stats[11]) + float(stats[12])) / TICKS_PER_SEC
|
"cpu_seconds_total", lambda: (float(stats[11]) + float(stats[12])) / TICKS_PER_SEC
|
||||||
)
|
)
|
||||||
|
|
||||||
|
process_metrics.register_callback(
|
||||||
|
"virtual_memory_bytes", lambda: int(stats[20])
|
||||||
|
)
|
||||||
|
process_metrics.register_callback(
|
||||||
|
"resident_memory_bytes", lambda: int(stats[21]) * BYTES_PER_PAGE
|
||||||
|
)
|
||||||
|
|
||||||
reactor_metrics = get_metrics_for("reactor")
|
reactor_metrics = get_metrics_for("reactor")
|
||||||
tick_time = reactor_metrics.register_distribution("tick_time")
|
tick_time = reactor_metrics.register_distribution("tick_time")
|
||||||
pending_calls_metric = reactor_metrics.register_distribution("pending_calls")
|
pending_calls_metric = reactor_metrics.register_distribution("pending_calls")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue