Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'rav/metrics_fixes' into matrix-org-hotfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Jan 18, 2018
2 parents 3517ab8 + d57765f commit 9249f11
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions synapse/util/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
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=(
Expand Down Expand Up @@ -76,7 +76,7 @@
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",
),
)

Expand Down Expand Up @@ -131,6 +131,8 @@ def __exit__(self, exc_type, exc_val, exc_tb):
return

duration = self.clock.time_msec() - self.start

block_counter.inc(self.name)
block_timer.inc_by(duration, self.name)

context = LoggingContext.current_context()
Expand Down

0 comments on commit 9249f11

Please sign in to comment.