mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Add some metrics on notifier
This commit is contained in:
parent
7827251daf
commit
872e75a3d5
@ -37,6 +37,10 @@ metrics = synapse.metrics.get_metrics_for(__name__)
|
|||||||
|
|
||||||
notified_events_counter = metrics.register_counter("notified_events")
|
notified_events_counter = metrics.register_counter("notified_events")
|
||||||
|
|
||||||
|
users_woken_by_stream_counter = metrics.register_counter(
|
||||||
|
"users_woken_by_stream", labels=["stream"]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# TODO(paul): Should be shared somewhere
|
# TODO(paul): Should be shared somewhere
|
||||||
def count(func, l):
|
def count(func, l):
|
||||||
@ -100,6 +104,8 @@ class _NotifierUserStream(object):
|
|||||||
self.last_notified_ms = time_now_ms
|
self.last_notified_ms = time_now_ms
|
||||||
noify_deferred = self.notify_deferred
|
noify_deferred = self.notify_deferred
|
||||||
|
|
||||||
|
users_woken_by_stream_counter.inc(stream_key)
|
||||||
|
|
||||||
with PreserveLoggingContext():
|
with PreserveLoggingContext():
|
||||||
self.notify_deferred = ObservableDeferred(defer.Deferred())
|
self.notify_deferred = ObservableDeferred(defer.Deferred())
|
||||||
noify_deferred.callback(self.current_token)
|
noify_deferred.callback(self.current_token)
|
||||||
|
Loading…
Reference in New Issue
Block a user