diff options
author | Olivier Wilkinson (reivilibre) <olivier@librepush.net> | 2019-08-28 14:57:03 +0100 |
---|---|---|
committer | Olivier Wilkinson (reivilibre) <olivier@librepush.net> | 2019-08-28 14:57:03 +0100 |
commit | d7a692f8608725ff5edca340a93f51ed76c743fb (patch) | |
tree | f836626ab114743a0ce1147ddec2a9951a55b53b | |
parent | Add incremental counting for rooms' total events and total event bytes. (diff) | |
download | synapse-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.py | 6 |
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): """ |