summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-06-22 15:51:11 +0100
committerGitHub <noreply@github.com>2018-06-22 15:51:11 +0100
commitfe8d2968e323c7f28caf5f72bb5265f521cf69ff (patch)
treec232a81f9354fe3adb87b24c444832b1bb3a5dd6
parentMerge pull request #3432 from matrix-org/rav/joined_hosts_cache_non_iterable (diff)
parentAlso log number of events for serach context (diff)
downloadsynapse-fe8d2968e323c7f28caf5f72bb5265f521cf69ff.tar.xz
Merge pull request #3434 from matrix-org/rav/search_logging
Add some logging to /search and /context queries
-rw-r--r--synapse/handlers/search.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/handlers/search.py b/synapse/handlers/search.py
index 1eca26aa1e..2e3a77ca4b 100644
--- a/synapse/handlers/search.py
+++ b/synapse/handlers/search.py
@@ -64,6 +64,13 @@ class SearchHandler(BaseHandler):
             except Exception:
                 raise SynapseError(400, "Invalid batch")
 
+        logger.info(
+            "Search batch properties: %r, %r, %r",
+            batch_group, batch_group_key, batch_token,
+        )
+
+        logger.info("Search content: %s", content)
+
         try:
             room_cat = content["search_categories"]["room_events"]
 
@@ -271,6 +278,8 @@ class SearchHandler(BaseHandler):
             # We should never get here due to the guard earlier.
             raise NotImplementedError()
 
+        logger.info("Found %d events to return", len(allowed_events))
+
         # If client has asked for "context" for each event (i.e. some surrounding
         # events and state), fetch that
         if event_context is not None:
@@ -282,6 +291,11 @@ class SearchHandler(BaseHandler):
                     event.room_id, event.event_id, before_limit, after_limit
                 )
 
+                logger.info(
+                    "Context for search returned %d and %d events",
+                    len(res["events_before"]), len(res["events_after"]),
+                )
+
                 res["events_before"] = yield filter_events_for_client(
                     self.store, user.to_string(), res["events_before"]
                 )