add some metrics on the federation sender (#6160)

This commit is contained in:
Richard van der Hoff 2019-10-03 17:47:20 +01:00 committed by GitHub
parent 6018bec919
commit 66537e10ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 19 deletions

View file

@ -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