summary refs log tree commit diff
path: root/synapse/util/metrics.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2021-06-16 15:35:00 +0100
committerRichard van der Hoff <richard@matrix.org>2021-06-16 15:35:00 +0100
commit89013b99bd6bf54c079db27059a57d48dc9bac0f (patch)
tree2cb94604893136c35e16e053139617b30f65c20b /synapse/util/metrics.py
parentMerge branch 'release-v1.36' into matrix-org-hotfixes (diff)
parentA guide to the request log lines format. (#8436) (diff)
downloadsynapse-89013b99bd6bf54c079db27059a57d48dc9bac0f.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/util/metrics.py')
-rw-r--r--synapse/util/metrics.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/util/metrics.py b/synapse/util/metrics.py

index 6d14351bd2..45353d41c5 100644 --- a/synapse/util/metrics.py +++ b/synapse/util/metrics.py
@@ -133,12 +133,17 @@ class Measure: self.start = self.clock.time() self._logging_context.__enter__() in_flight.register((self.name,), self._update_in_flight) + + logger.debug("Entering block %s", self.name) + return self def __exit__(self, exc_type, exc_val, exc_tb): if self.start is None: raise RuntimeError("Measure() block exited without being entered") + logger.debug("Exiting block %s", self.name) + duration = self.clock.time() - self.start usage = self.get_resource_usage()