summary refs log tree commit diff
path: root/synapse/util
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-10-03 17:47:20 +0100
committerGitHub <noreply@github.com>2019-10-03 17:47:20 +0100
commit66537e10ce77e47fac52e3f27569ac1ef0f1aaa3 (patch)
treed557a39cc0b62b84af72eed87692aee280625c35 /synapse/util
parentMerge branch 'master' into develop (diff)
downloadsynapse-66537e10ce77e47fac52e3f27569ac1ef0f1aaa3.tar.xz
add some metrics on the federation sender (#6160)
Diffstat (limited to 'synapse/util')
-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