summary refs log tree commit diff
path: root/synapse/metrics/__init__.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-05-13 16:31:08 +0100
committerErik Johnston <erik@matrix.org>2016-05-13 16:31:08 +0100
commit7d6e89ed22aab4bae9ce033c2e4757a595257942 (patch)
tree408360499e77d4ed6e1beffa92ce431ee060fe35 /synapse/metrics/__init__.py
parentManually run GC on reactor tick. (diff)
downloadsynapse-7d6e89ed22aab4bae9ce033c2e4757a595257942.tar.xz
Add a comment
Diffstat (limited to 'synapse/metrics/__init__.py')
-rw-r--r--synapse/metrics/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index 17be491b93..c82685a524 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -185,6 +185,8 @@ def runUntilCurrentTimer(func):
         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()
 
@@ -210,6 +212,9 @@ try:
     # 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