summary refs log tree commit diff
path: root/synapse/util/metrics.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-10 13:10:57 +0100
committerErik Johnston <erik@matrix.org>2019-10-10 13:10:57 +0100
commit91f43dca3939cd6ccbc90d19a284d00f6e14fd7c (patch)
treecb15ddf14a01a0e67b9eaf91b482d65bf2057f4e /synapse/util/metrics.py
parentNewsfile (diff)
parentAdd domain validation when creating room with list of invitees (#6121) (diff)
downloadsynapse-91f43dca3939cd6ccbc90d19a284d00f6e14fd7c.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/disable_sql_bytes
Diffstat (limited to 'synapse/util/metrics.py')
-rw-r--r--synapse/util/metrics.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/util/metrics.py b/synapse/util/metrics.py
index 0910930c21..4b1bcdf23c 100644
--- a/synapse/util/metrics.py
+++ b/synapse/util/metrics.py
@@ -60,12 +60,14 @@ in_flight = InFlightGauge(
 )
 
 
-def measure_func(name):
+def measure_func(name=None):
     def wrapper(func):
+        block_name = func.__name__ if name is None else name
+
         @wraps(func)
         @defer.inlineCallbacks
         def measured_func(self, *args, **kwargs):
-            with Measure(self.clock, name):
+            with Measure(self.clock, block_name):
                 r = yield func(self, *args, **kwargs)
             return r