summary refs log tree commit diff
path: root/synapse/notifier.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-03-15 10:56:51 +0000
committerErik Johnston <erik@matrix.org>2017-03-15 10:56:51 +0000
commit872e75a3d5d9458d0242fd2421fba06049a951be (patch)
treec3f5f49dcc0149153b31fe6a7ded277270822de4 /synapse/notifier.py
parentMerge pull request #1994 from matrix-org/dbkr/msisdn_signin_2 (diff)
downloadsynapse-872e75a3d5d9458d0242fd2421fba06049a951be.tar.xz
Add some metrics on notifier
Diffstat (limited to '')
-rw-r--r--synapse/notifier.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py
index 6abb33bb3f..2657dcd8dc 100644
--- a/synapse/notifier.py
+++ b/synapse/notifier.py
@@ -37,6 +37,10 @@ metrics = synapse.metrics.get_metrics_for(__name__)
 
 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
 def count(func, l):
@@ -100,6 +104,8 @@ class _NotifierUserStream(object):
         self.last_notified_ms = time_now_ms
         noify_deferred = self.notify_deferred
 
+        users_woken_by_stream_counter.inc(stream_key)
+
         with PreserveLoggingContext():
             self.notify_deferred = ObservableDeferred(defer.Deferred())
             noify_deferred.callback(self.current_token)