diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-07-19 20:58:18 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-19 20:58:18 +1000 |
commit | 95ccb6e2ec57f2150a697ea9cde030e8f78d6db9 (patch) | |
tree | 7ef62670b02e1d55d3c79bdffdaecba9ddd76ebc /synapse/util/logcontext.py | |
parent | Merge pull request #3507 from Peetz0r/patch-1 (diff) | |
download | synapse-95ccb6e2ec57f2150a697ea9cde030e8f78d6db9.tar.xz |
Don't spew errors because we can't save metrics (#3563)
Diffstat (limited to 'synapse/util/logcontext.py')
-rw-r--r-- | synapse/util/logcontext.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/util/logcontext.py b/synapse/util/logcontext.py index f6c7175f74..8dcae50b39 100644 --- a/synapse/util/logcontext.py +++ b/synapse/util/logcontext.py @@ -99,6 +99,17 @@ class ContextResourceUsage(object): self.db_sched_duration_sec = 0 self.evt_db_fetch_count = 0 + def __repr__(self): + return ("<ContextResourceUsage ru_stime='%r', ru_utime='%r', " + "db_txn_count='%r', db_txn_duration_sec='%r', " + "db_sched_duration_sec='%r', evt_db_fetch_count='%r'>") % ( + self.ru_stime, + self.ru_utime, + self.db_txn_count, + self.db_txn_duration_sec, + self.db_sched_duration_sec, + self.evt_db_fetch_count,) + def __iadd__(self, other): """Add another ContextResourceUsage's stats to this one's. |