Some cleanup

This commit is contained in:
Eric Eastwood 2022-08-18 16:55:11 -05:00
parent 0f2bfa4224
commit db04b16060
3 changed files with 6 additions and 3 deletions

View file

@ -494,6 +494,10 @@ class FederationHandler:
return False
processing_end_time = self.clock.time_msec()
logger.info(
"backfill_processing_before_timer asfd=%s",
(processing_start_time - processing_end_time) / 1000,
)
backfill_processing_before_timer.observe(
(processing_start_time - processing_end_time) / 1000
)

View file

@ -910,7 +910,9 @@ def trace_with_opname(
def trace(func: Callable[P, R]) -> Callable[P, R]:
"""
Decorator to trace a function.
Sets the operation name to that of the function's name.
See the module's doc string for usage examples.
"""
return trace_with_opname(func.__name__)(func)

View file

@ -263,11 +263,8 @@ class _PerHostRatelimiter:
# Ensure that we've properly cleaned up.
self.sleeping_requests.discard(request_id)
self.ready_request_queue.pop(request_id, None)
wait_span_cm.__exit__(None, None, None)
return r
wait_span_cm = start_active_span("ratelimit wait")
wait_span_cm.__enter__()
ret_defer.addCallbacks(on_start, on_err)
ret_defer.addBoth(on_both)
return make_deferred_yieldable(ret_defer)