mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:26:09 -04:00
Make RequestMetrics take a raw time rather than a clock
... which is going to make it easier to move around.
This commit is contained in:
parent
8460e48d06
commit
09b29f9c4a
2 changed files with 6 additions and 6 deletions
|
@ -100,12 +100,12 @@ response_size = metrics.register_counter(
|
|||
|
||||
|
||||
class RequestMetrics(object):
|
||||
def start(self, clock, name):
|
||||
self.start = clock.time_msec()
|
||||
def start(self, time_msec, name):
|
||||
self.start = time_msec
|
||||
self.start_context = LoggingContext.current_context()
|
||||
self.name = name
|
||||
|
||||
def stop(self, clock, request):
|
||||
def stop(self, time_msec, request):
|
||||
context = LoggingContext.current_context()
|
||||
|
||||
tag = ""
|
||||
|
@ -122,7 +122,7 @@ class RequestMetrics(object):
|
|||
response_count.inc(request.method, self.name, tag)
|
||||
|
||||
response_timer.inc_by(
|
||||
clock.time_msec() - self.start, request.method,
|
||||
time_msec - self.start, request.method,
|
||||
self.name, tag
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue