mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-25 02:29:25 -05:00
Change the way we do stats
This commit is contained in:
parent
8c966fbd51
commit
75331c5fca
@ -153,11 +153,7 @@ reactor_metrics = get_metrics_for("reactor")
|
||||
tick_time = reactor_metrics.register_distribution("tick_time")
|
||||
pending_calls_metric = reactor_metrics.register_distribution("pending_calls")
|
||||
|
||||
gc_time = (
|
||||
reactor_metrics.register_distribution("gc_time_gen0"),
|
||||
reactor_metrics.register_distribution("gc_time_gen2"),
|
||||
reactor_metrics.register_distribution("gc_time_gen2"),
|
||||
)
|
||||
gc_time = reactor_metrics.register_distribution("gc_time", labels=["gen"])
|
||||
|
||||
|
||||
def runUntilCurrentTimer(func):
|
||||
@ -190,7 +186,7 @@ def runUntilCurrentTimer(func):
|
||||
# one if necessary.
|
||||
threshold = gc.get_threshold()
|
||||
counts = gc.get_count()
|
||||
for i in [2, 1, 0]:
|
||||
for i in (0, 1, 2):
|
||||
if threshold[i] < counts[i]:
|
||||
logger.info("Collecting gc %d", i)
|
||||
|
||||
@ -198,7 +194,7 @@ def runUntilCurrentTimer(func):
|
||||
gc.collect(i)
|
||||
end = time.time() * 1000
|
||||
|
||||
gc_time[i].inc_by(end - start)
|
||||
gc_time.inc_by(end - start, i)
|
||||
|
||||
return ret
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user