summary refs log tree commit diff
path: root/synapse/handlers/appservice.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-04-12 11:18:19 +0100
committerErik Johnston <erik@matrix.org>2018-04-12 11:18:19 +0100
commitf67e906e189cb528cab18cb5190be352dcc8914b (patch)
tree068855c9368538c37ba3c161a5b291c299db7a0e /synapse/handlers/appservice.py
parentFix tests (diff)
downloadsynapse-f67e906e189cb528cab18cb5190be352dcc8914b.tar.xz
Set all metrics at the same time
Diffstat (limited to 'synapse/handlers/appservice.py')
-rw-r--r--synapse/handlers/appservice.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py
index fcc1246bee..ce0814bc25 100644
--- a/synapse/handlers/appservice.py
+++ b/synapse/handlers/appservice.py
@@ -108,16 +108,16 @@ class ApplicationServicesHandler(object):
                                 service, event
                             )
 
-                    events_processed_counter.inc_by(len(events))
-
                     yield self.store.set_appservice_last_pos(upper_bound)
 
+                    now = self.clock.time_msec()
+                    ts = yield self.store.get_received_ts(events[-1].event_id)
+
                     synapse.metrics.event_processing_positions.set(
                         upper_bound, "appservice_sender",
                     )
 
-                    now = self.clock.time_msec()
-                    ts = yield self.store.get_received_ts(events[-1].event_id)
+                    events_processed_counter.inc_by(len(events))
 
                     synapse.metrics.event_processing_lag.set(
                         now - ts, "appservice_sender",