diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2016-10-27 18:07:34 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2016-10-27 18:07:34 +0100 |
commit | ccc1a3d54d08a90152100f3d57b1b912482281a6 (patch) | |
tree | 7ed7d4d66aa16130cea5f3287511f433499aeefa /synapse/metrics | |
parent | Merge pull request #1183 from matrix-org/erikj/fix_email_update (diff) | |
download | synapse-ccc1a3d54d08a90152100f3d57b1b912482281a6.tar.xz |
Allow creation of a 'subspace' within a Metrics object, returning another one
Diffstat (limited to 'synapse/metrics')
-rw-r--r-- | synapse/metrics/__init__.py | 3 |
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) |