Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed May 13, 2016
1 parent 1f1dee9 commit 7d6e89e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions synapse/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ def f(*args, **kwargs):
tick_time.inc_by(end - start)
pending_calls_metric.inc_by(num_pending)

# Check if we need to do a manual GC (since its been disabled), and do
# one if necessary.
threshold = gc.get_threshold()
counts = gc.get_count()

Expand All @@ -210,6 +212,9 @@ def f(*args, **kwargs):
# runUntilCurrent is called when we have pending calls. It is called once
# per iteratation after fd polling.
reactor.runUntilCurrent = runUntilCurrentTimer(reactor.runUntilCurrent)

# We manually run the GC each reactor tick so that we can get some metrics
# about time spent doing GC,
gc.disable()
except AttributeError:
pass

0 comments on commit 7d6e89e

Please sign in to comment.