From ccc1a3d54d08a90152100f3d57b1b912482281a6 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Thu, 27 Oct 2016 18:07:34 +0100 Subject: Allow creation of a 'subspace' within a Metrics object, returning another one --- synapse/metrics/__init__.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'synapse/metrics/__init__.py') 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) -- cgit 1.4.1