diff options
author | Erik Johnston <erik@matrix.org> | 2021-11-08 14:32:48 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2021-11-08 14:32:48 +0000 |
commit | 49c9424c0e1eddb16a04a23c6d067070b03067f9 (patch) | |
tree | 2336a70db938bb2dfafd54df8021bacc3aaae38d /synapse/metrics/__init__.py | |
parent | Log long callFromThread (diff) | |
download | synapse-49c9424c0e1eddb16a04a23c6d067070b03067f9.tar.xz |
install timers
Diffstat (limited to 'synapse/metrics/__init__.py')
-rw-r--r-- | synapse/metrics/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py index 4bf081e254..d7475ddf12 100644 --- a/synapse/metrics/__init__.py +++ b/synapse/metrics/__init__.py @@ -584,7 +584,7 @@ MIN_TIME_BETWEEN_GCS = (1.0, 10.0, 30.0) _last_gc = [0.0, 0.0, 0.0] -def callFromThreadTimer(reactor, func): +def callFromThreadTimer(func): @functools.wraps(func) def callFromThread( self, f: Callable[..., Any], *args: object, **kwargs: object @@ -695,6 +695,8 @@ try: # per iteratation after fd polling. reactor.runUntilCurrent = runUntilCurrentTimer(reactor, reactor.runUntilCurrent) # type: ignore + reactor.callFromThread = callFromThreadTimer(reactor.callFromThread) + # We manually run the GC each reactor tick so that we can get some metrics # about time spent doing GC, if not running_on_pypy: |