Add a counter to track total number of events served by the notifier

This commit is contained in:
Paul "LeoNerd" Evans 2015-03-10 18:06:24 +00:00
parent 2e4f0b2bd7
commit 89ac1fa8ba

View File

@ -28,6 +28,8 @@ logger = logging.getLogger(__name__)
metrics = synapse.metrics.get_metrics_for(__name__) metrics = synapse.metrics.get_metrics_for(__name__)
notified_events_counter = metrics.register_counter("notified_events")
# TODO(paul): Should be shared somewhere # TODO(paul): Should be shared somewhere
def count(func, l): def count(func, l):
@ -72,6 +74,7 @@ class _NotificationListener(object):
try: try:
self.deferred.callback(result) self.deferred.callback(result)
notified_events_counter.inc_by(len(events))
except defer.AlreadyCalledError: except defer.AlreadyCalledError:
pass pass