summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-06-08 10:05:49 +0100
committerErik Johnston <erik@matrix.org>2016-06-08 10:05:49 +0100
commit02270b4b3dbd97eae12bd6ae0f5d76aae45bbc4f (patch)
treee053faaeefdfaf185312847d54ee4d574b717c41 /synapse
parentMerge pull request #851 from matrix-org/markjh/jenkins_synchrotron (diff)
parentDon't track total objects as its too expensive to calculate (diff)
downloadsynapse-02270b4b3dbd97eae12bd6ae0f5d76aae45bbc4f.tar.xz
Merge pull request #852 from matrix-org/erikj/gc_metrics
Add GC counts to metrics
Diffstat (limited to 'synapse')
-rw-r--r--synapse/metrics/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index b29cec3de1..bdd7292a30 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -156,6 +156,10 @@ pending_calls_metric = reactor_metrics.register_distribution("pending_calls")
 gc_time = reactor_metrics.register_distribution("gc_time", labels=["gen"])
 gc_unreachable = reactor_metrics.register_counter("gc_unreachable", labels=["gen"])
 
+reactor_metrics.register_callback(
+    "gc_counts", lambda: {(i,): v for i, v in enumerate(gc.get_count())}, labels=["gen"]
+)
+
 
 def runUntilCurrentTimer(func):