summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-04-14 11:26:15 +0100
committerErik Johnston <erik@matrix.org>2016-04-14 11:26:15 +0100
commit7be1065b8f6b6a4e865342f7fdadd00474b624ca (patch)
tree97371f9a6420566207659a9fc49d4139ca3b70ab /synapse
parentFix query for get_unread_push_actions_for_user_in_range (diff)
downloadsynapse-7be1065b8f6b6a4e865342f7fdadd00474b624ca.tar.xz
Add extra Measure
Diffstat (limited to 'synapse')
-rw-r--r--synapse/push/httppusher.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py
index 57f0a69e03..0ceff661e7 100644
--- a/synapse/push/httppusher.py
+++ b/synapse/push/httppusher.py
@@ -114,20 +114,22 @@ class HttpPusher(object):
     def _process(self):
         if self.processing:
             return
-        try:
-            self.processing = True
-            # if the max ordering changes while we're running _unsafe_process,
-            # call it again, and so on until we've caught up.
-            while True:
-                starting_max_ordering = self.max_stream_ordering
-                try:
-                    yield self._unsafe_process()
-                except:
-                    logger.exception("Exception processing notifs")
-                if self.max_stream_ordering == starting_max_ordering:
-                    break
-        finally:
-            self.processing = False
+
+        with Measure(self.clock, "push._process"):
+            try:
+                self.processing = True
+                # if the max ordering changes while we're running _unsafe_process,
+                # call it again, and so on until we've caught up.
+                while True:
+                    starting_max_ordering = self.max_stream_ordering
+                    try:
+                        yield self._unsafe_process()
+                    except:
+                        logger.exception("Exception processing notifs")
+                    if self.max_stream_ordering == starting_max_ordering:
+                        break
+            finally:
+                self.processing = False
 
     @defer.inlineCallbacks
     def _unsafe_process(self):