summary refs log tree commit diff
path: root/synapse/metrics/__init__.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-07-20 16:32:38 +0100
committerGitHub <noreply@github.com>2016-07-20 16:32:38 +0100
commitb73dc0ef4de07a9062b858332d0a12e8805cb8b8 (patch)
treedc9379f33f92b1a1e990b77737c6e0401b4d5a8f /synapse/metrics/__init__.py
parentMerge pull request #935 from matrix-org/erikj/backfill_notifs (diff)
parentMake jenkins install deps on unit tests (diff)
downloadsynapse-b73dc0ef4de07a9062b858332d0a12e8805cb8b8.tar.xz
Merge pull request #936 from matrix-org/erikj/log_rss
Add metrics for psutil derived memory usage
Diffstat (limited to 'synapse/metrics/__init__.py')
-rw-r--r--synapse/metrics/__init__.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index bdd7292a30..cce3dba47c 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -27,7 +27,8 @@ import gc
 from twisted.internet import reactor
 
 from .metric import (
-    CounterMetric, CallbackMetric, DistributionMetric, CacheMetric
+    CounterMetric, CallbackMetric, DistributionMetric, CacheMetric,
+    MemoryUsageMetric,
 )
 
 
@@ -66,6 +67,12 @@ class Metrics(object):
         return self._register(CacheMetric, *args, **kwargs)
 
 
+def register_memory_metrics(hs):
+    metric = MemoryUsageMetric(hs)
+    all_metrics.append(metric)
+    return metric
+
+
 def get_metrics_for(pkg_name):
     """ Returns a Metrics instance for conveniently creating metrics
     namespaced with the given name prefix. """