diff options
author | Erik Johnston <erik@matrix.org> | 2015-08-19 09:26:14 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-08-19 10:17:33 +0100 |
commit | 118bb5c036ee1e5613a49c7cd862c5372708ac71 (patch) | |
tree | 4b42a1304839ff0b4c09eb55ae6a3f6054aec59b | |
parent | Time CPU time spent in each log context (diff) | |
download | synapse-github/erikj/context_cpu_timing.tar.xz |
Cheekily use RUSAGE_THREAD github/erikj/context_cpu_timing erikj/context_cpu_timing
-rw-r--r-- | synapse/util/logcontext.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/util/logcontext.py b/synapse/util/logcontext.py index 8a36bbf32d..8c57671b66 100644 --- a/synapse/util/logcontext.py +++ b/synapse/util/logcontext.py @@ -23,7 +23,8 @@ logger = logging.getLogger(__name__) def _get_cpu_time(): - return getrusage(RUSAGE_SELF).ru_utime * 1000 + # Cheekily use RUSAGE_THREAD. THIS IS NOT PORTABLE + return getrusage(1).ru_utime * 1000 class LoggingContext(object): |