Merge pull request #1031 from matrix-org/erikj/measure_notifier

Add more Measure blocks
This commit is contained in:
Erik Johnston 2016-08-22 12:13:07 +01:00 committed by GitHub
commit e65bc7d315
6 changed files with 182 additions and 178 deletions

View file

@ -87,7 +87,7 @@ class Measure(object):
self.db_txn_duration = self.start_context.db_txn_duration
def __exit__(self, exc_type, exc_val, exc_tb):
if exc_type is not None or not self.start_context:
if isinstance(exc_type, Exception) or not self.start_context:
return
duration = self.clock.time_msec() - self.start