summary refs log tree commit diff
path: root/synapse/metrics
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-13 16:58:23 +0100
committerErik Johnston <erik@matrix.org>2015-08-13 16:58:23 +0100
commit5db56779699a3c9a95701e6373ac8bd5cace7860 (patch)
treed26a26569ec3f45931c68f22e99f3fc1bb38892f /synapse/metrics
parentRe-enable receipts (diff)
downloadsynapse-5db56779699a3c9a95701e6373ac8bd5cace7860.tar.xz
Add metrics to the receipts cache
Diffstat (limited to 'synapse/metrics')
-rw-r--r--synapse/metrics/metric.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/metrics/metric.py b/synapse/metrics/metric.py
index 21b37748f6..5b1e9c3ddc 100644
--- a/synapse/metrics/metric.py
+++ b/synapse/metrics/metric.py
@@ -151,5 +151,12 @@ class CacheMetric(object):
     def inc_misses(self, *values):
         self.total.inc(*values)
 
+    def inc_hits_by(self, inc, *values):
+        self.hits.inc_by(inc, *values)
+        self.total.inc_by(inc, *values)
+
+    def inc_misses_by(self, inc, *values):
+        self.total.inc_by(inc, *values)
+
     def render(self):
         return self.hits.render() + self.total.render() + self.size.render()