diff options
author | Mark Haines <mark.haines@matrix.org> | 2016-10-28 11:12:31 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2016-10-28 11:12:31 +0100 |
commit | 490b97d3e7c89981085fcc700c6e776a7d913ac7 (patch) | |
tree | b4282c1b24da3a1c5ef416ff77f65c39798c73b2 /synapse/metrics/__init__.py | |
parent | Bump changelog and version (diff) | |
parent | Merge pull request #1184 from matrix-org/paul/metrics (diff) | |
download | synapse-490b97d3e7c89981085fcc700c6e776a7d913ac7.tar.xz |
Merge branch 'develop' into release-v0.18.2
Diffstat (limited to 'synapse/metrics/__init__.py')
-rw-r--r-- | synapse/metrics/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py index a6b868775d..7041da25ce 100644 --- a/synapse/metrics/__init__.py +++ b/synapse/metrics/__init__.py @@ -24,6 +24,7 @@ from .metric import ( CounterMetric, CallbackMetric, DistributionMetric, CacheMetric, MemoryUsageMetric, ) +from .process_collector import register_process_collector logger = logging.getLogger(__name__) @@ -41,6 +42,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) @@ -118,6 +122,8 @@ reactor_metrics.register_callback( "gc_counts", lambda: {(i,): v for i, v in enumerate(gc.get_count())}, labels=["gen"] ) +register_process_collector(get_metrics_for("process")) + def runUntilCurrentTimer(func): |