summary refs log tree commit diff
path: root/synapse/util/logcontext.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-07-19 16:40:28 +0100
committerRichard van der Hoff <richard@matrix.org>2018-07-19 16:40:28 +0100
commit9e56e1ab301efe225105a5f2dd0fee9877210f85 (patch)
treeab789ea7a79fab81437320ef97d3a6966fdc9cb4 /synapse/util/logcontext.py
parentMerge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes (diff)
parentMerge branch 'master' into develop (diff)
downloadsynapse-9e56e1ab301efe225105a5f2dd0fee9877210f85.tar.xz
Merge branch 'develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/util/logcontext.py')
-rw-r--r--synapse/util/logcontext.py11
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.