summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2018-01-23 19:39:26 +0000
committerGitHub <noreply@github.com>2018-01-23 19:39:26 +0000
commit25e2456ee7ee7f53d5452db4a38d0c4cccc53fd8 (patch)
treee2e81cb20b566f0ecc1eb2ef5e406073b9850f73 /synapse
parentadd ?ts massaging for ASes (#2754) (diff)
parentAdd some comments about the reactor tick time metric (diff)
downloadsynapse-25e2456ee7ee7f53d5452db4a38d0c4cccc53fd8.tar.xz
Merge pull request #2816 from matrix-org/rav/metrics_comments
Add some comments about the reactor tick time metric
Diffstat (limited to 'synapse')
-rw-r--r--synapse/metrics/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index 2265e6e8d6..e0cfb7d08f 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -146,10 +146,15 @@ def runUntilCurrentTimer(func):
             num_pending += 1
 
         num_pending += len(reactor.threadCallQueue)
-
         start = time.time() * 1000
         ret = func(*args, **kwargs)
         end = time.time() * 1000
+
+        # record the amount of wallclock time spent running pending calls.
+        # This is a proxy for the actual amount of time between reactor polls,
+        # since about 25% of time is actually spent running things triggered by
+        # I/O events, but that is harder to capture without rewriting half the
+        # reactor.
         tick_time.inc_by(end - start)
         pending_calls_metric.inc_by(num_pending)