summary refs log tree commit diff
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-28 14:57:03 +0100
committerOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-28 14:57:03 +0100
commitd7a692f8608725ff5edca340a93f51ed76c743fb (patch)
treef836626ab114743a0ce1147ddec2a9951a55b53b
parentAdd incremental counting for rooms' total events and total event bytes. (diff)
downloadsynapse-d7a692f8608725ff5edca340a93f51ed76c743fb.tar.xz
Update total_events and total_event_bytes on new events.
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
-rw-r--r--synapse/handlers/stats.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/handlers/stats.py b/synapse/handlers/stats.py
index 7536e1a54c..e9b1646e0e 100644
--- a/synapse/handlers/stats.py
+++ b/synapse/handlers/stats.py
@@ -111,6 +111,12 @@ class StatsHandler(StateDeltasHandler):
                 if self.pos is not None:
                     yield self.store.update_stats_positions(self.pos)
 
+        # Then count deltas for total_events and total_event_bytes.
+        with Measure(self.clock, "stats_total_events_and_bytes"):
+            self.pos = yield self.store.incremental_update_total_events_and_bytes(
+                self.pos
+            )
+
     @defer.inlineCallbacks
     def _handle_deltas(self, deltas):
         """