Set all metrics at the same time

This commit is contained in:
Erik Johnston 2018-04-12 11:18:19 +01:00
parent e939f3bca6
commit f67e906e18
2 changed files with 10 additions and 10 deletions

View File

@ -233,16 +233,10 @@ class TransactionQueue(object):
consumeErrors=True consumeErrors=True
)) ))
events_processed_counter.inc_by(len(events))
yield self.store.update_federation_out_pos( yield self.store.update_federation_out_pos(
"events", next_token "events", next_token
) )
synapse.metrics.event_processing_positions.set(
next_token, "federation_sender",
)
if events: if events:
now = self.clock.time_msec() now = self.clock.time_msec()
ts = yield self.store.get_received_ts(events[-1].event_id) ts = yield self.store.get_received_ts(events[-1].event_id)
@ -254,6 +248,12 @@ class TransactionQueue(object):
ts, "federation_sender", ts, "federation_sender",
) )
events_processed_counter.inc_by(len(events))
synapse.metrics.event_processing_positions.set(
next_token, "federation_sender",
)
finally: finally:
self._is_processing = False self._is_processing = False

View File

@ -108,16 +108,16 @@ class ApplicationServicesHandler(object):
service, event service, event
) )
events_processed_counter.inc_by(len(events))
yield self.store.set_appservice_last_pos(upper_bound) 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( synapse.metrics.event_processing_positions.set(
upper_bound, "appservice_sender", upper_bound, "appservice_sender",
) )
now = self.clock.time_msec() events_processed_counter.inc_by(len(events))
ts = yield self.store.get_received_ts(events[-1].event_id)
synapse.metrics.event_processing_lag.set( synapse.metrics.event_processing_lag.set(
now - ts, "appservice_sender", now - ts, "appservice_sender",