summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-04-07 17:12:29 +0100
committerDavid Baker <dave@matrix.org>2016-04-07 17:12:29 +0100
commitfa129ce5b5cfa2b6cbbb0f1a884f47d740ba1300 (patch)
treecae4dc9b950fefaa38aed4467b25a517f1734165 /synapse/push
parentAdd comments on min_stream_id (diff)
downloadsynapse-fa129ce5b5cfa2b6cbbb0f1a884f47d740ba1300.tar.xz
Add measure blocks
Diffstat (limited to '')
-rw-r--r--synapse/push/httppusher.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py
index 0a1d3817de..ea45b603c6 100644
--- a/synapse/push/httppusher.py
+++ b/synapse/push/httppusher.py
@@ -21,6 +21,8 @@ import logging
 import push_rule_evaluator
 import push_tools
 
+from synapse.util.metrics import Measure
+
 logger = logging.getLogger(__name__)
 
 
@@ -82,8 +84,9 @@ class HttpPusher(object):
 
     @defer.inlineCallbacks
     def on_new_notifications(self, min_stream_ordering, max_stream_ordering):
-        self.max_stream_ordering = max_stream_ordering
-        yield self._process()
+        with Measure(self.clock, "push.on_new_notifications"):
+            self.max_stream_ordering = max_stream_ordering
+            yield self._process()
 
     @defer.inlineCallbacks
     def on_new_receipts(self, min_stream_id, max_stream_id):
@@ -91,12 +94,14 @@ class HttpPusher(object):
 
         # We could check the receipts are actually m.read receipts here,
         # but currently that's the only type of receipt anyway...
-        badge = yield push_tools.get_badge_count(self.hs, self.user_id)
-        yield self.send_badge(badge)
+        with Measure(self.clock, "push.on_new_receipts"):
+            badge = yield push_tools.get_badge_count(self.hs, self.user_id)
+            yield self.send_badge(badge)
 
     @defer.inlineCallbacks
     def on_timer(self):
-        yield self._process()
+        with Measure(self.clock, "push.on_timer"):
+            yield self._process()
 
     def on_stop(self):
         if self.timed_call: