Allow creation of a 'subspace' within a Metrics object, returning another one

This commit is contained in:
Paul "LeoNerd" Evans 2016-10-27 18:07:34 +01:00
parent e438699c59
commit ccc1a3d54d
1 changed files with 3 additions and 0 deletions

View File

@ -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)