summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2016-10-27 18:07:34 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2016-10-27 18:07:34 +0100
commitccc1a3d54d08a90152100f3d57b1b912482281a6 (patch)
tree7ed7d4d66aa16130cea5f3287511f433499aeefa /synapse
parentMerge pull request #1183 from matrix-org/erikj/fix_email_update (diff)
downloadsynapse-ccc1a3d54d08a90152100f3d57b1b912482281a6.tar.xz
Allow creation of a 'subspace' within a Metrics object, returning another one
Diffstat (limited to 'synapse')
-rw-r--r--synapse/metrics/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index a6b868775d..f6c084169b 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -41,6 +41,9 @@ class Metrics(object):
     def __init__(self, name):
         self.name_prefix = name
 
+    def make_subspace(self, name):
+        return Metrics("%s_%s" % (self.name_prefix, name))
+
     def register_collector(self, func):
         all_collectors.append(func)