mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 15:16:04 -04:00
Fix up logcontexts
This commit is contained in:
parent
13e6262659
commit
2c1fbea531
31 changed files with 356 additions and 229 deletions
|
@ -68,16 +68,18 @@ class Measure(object):
|
|||
block_timer.inc_by(duration, self.name)
|
||||
|
||||
context = LoggingContext.current_context()
|
||||
if not context:
|
||||
return
|
||||
|
||||
if context != self.start_context:
|
||||
logger.warn(
|
||||
"Context have unexpectedly changed %r, %r",
|
||||
context, self.start_context
|
||||
"Context have unexpectedly changed from '%s' to '%s'. (%r)",
|
||||
context, self.start_context, self.name
|
||||
)
|
||||
return
|
||||
|
||||
if not context:
|
||||
logger.warn("Expected context. (%r)", self.name)
|
||||
return
|
||||
|
||||
ru_utime, ru_stime = context.get_resource_usage()
|
||||
|
||||
block_ru_utime.inc_by(ru_utime, self.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue