diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-01-18 12:23:04 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-01-18 12:24:42 +0000 |
commit | d57765fc8a1b54dae001bbb97b2b529991292fbc (patch) | |
tree | b041d732acd3516345d184275261324366ab5ba5 | |
parent | Merge pull request #2809 from matrix-org/rav/metrics_errors (diff) | |
download | synapse-d57765fc8a1b54dae001bbb97b2b529991292fbc.tar.xz |
Fix bugs in block metrics
... which I introduced in #2785
-rw-r--r-- | synapse/util/metrics.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/util/metrics.py b/synapse/util/metrics.py index 059bb7fedf..e4b5687a4b 100644 --- a/synapse/util/metrics.py +++ b/synapse/util/metrics.py @@ -28,7 +28,7 @@ logger = logging.getLogger(__name__) metrics = synapse.metrics.get_metrics_for(__name__) # total number of times we have hit this block -response_count = metrics.register_counter( +block_counter = metrics.register_counter( "block_count", labels=["block_name"], alternative_names=( @@ -76,7 +76,7 @@ block_db_txn_count = metrics.register_counter( block_db_txn_duration = metrics.register_counter( "block_db_txn_duration_seconds", labels=["block_name"], alternative_names=( - metrics.name_prefix + "_block_db_txn_count:total", + metrics.name_prefix + "_block_db_txn_duration:total", ), ) @@ -131,6 +131,8 @@ class Measure(object): return duration = self.clock.time_msec() - self.start + + block_counter.inc(self.name) block_timer.inc_by(duration, self.name) context = LoggingContext.current_context() |