summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-06-22 11:17:56 +0100
committerGitHub <noreply@github.com>2018-06-22 11:17:56 +0100
commit70e650191347eaf3d560ffb116b92f258e9ee52a (patch)
treeb3b24c7fc1cf58d110c6bb05adde80f02753f3b4 /synapse/storage
parentMerge pull request #3418 from matrix-org/rav/fix_metric_desc (diff)
parentIndirect evt_count updates via method call (diff)
downloadsynapse-70e650191347eaf3d560ffb116b92f258e9ee52a.tar.xz
Merge pull request #3419 from matrix-org/rav/events_per_request
Log number of events fetched from DB
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/events_worker.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/storage/events_worker.py b/synapse/storage/events_worker.py
index 38fcf7d444..f6a6e46b43 100644
--- a/synapse/storage/events_worker.py
+++ b/synapse/storage/events_worker.py
@@ -21,6 +21,7 @@ from synapse.events.utils import prune_event
 
 from synapse.util.logcontext import (
     PreserveLoggingContext, make_deferred_yieldable, run_in_background,
+    LoggingContext,
 )
 from synapse.util.metrics import Measure
 from synapse.api.errors import SynapseError
@@ -145,6 +146,9 @@ class EventsWorkerStore(SQLBaseStore):
         missing_events_ids = [e for e in event_ids if e not in event_entry_map]
 
         if missing_events_ids:
+            log_ctx = LoggingContext.current_context()
+            log_ctx.record_event_fetch(len(missing_events_ids))
+
             missing_events = yield self._enqueue_events(
                 missing_events_ids,
                 check_redacted=check_redacted,