diff options
author | Erik Johnston <erikj@jki.re> | 2016-08-08 11:24:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-08 11:24:11 +0100 |
commit | e7674eb759645b7989f0d79eb6598a1d9929efaa (patch) | |
tree | c3189b92b1e502551a856dbd7631e373fd7f9e33 /synapse/metrics/metric.py | |
parent | Merge pull request #991 from matrix-org/erikj/retry_make (diff) | |
parent | Make psutil optional (diff) | |
download | synapse-e7674eb759645b7989f0d79eb6598a1d9929efaa.tar.xz |
Merge pull request #992 from matrix-org/erikj/psutil_conditional
Make psutil optional
Diffstat (limited to 'synapse/metrics/metric.py')
-rw-r--r-- | synapse/metrics/metric.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/synapse/metrics/metric.py b/synapse/metrics/metric.py index 7becbe0491..e81af29895 100644 --- a/synapse/metrics/metric.py +++ b/synapse/metrics/metric.py @@ -16,8 +16,6 @@ from itertools import chain -import psutil - # TODO(paul): I can't believe Python doesn't have one of these def map_concat(func, items): @@ -167,9 +165,10 @@ class MemoryUsageMetric(object): UPDATE_HZ = 2 # number of times to get memory per second WINDOW_SIZE_SEC = 30 # the size of the window in seconds - def __init__(self, hs): + def __init__(self, hs, psutil): clock = hs.get_clock() self.memory_snapshots = [] + self.process = psutil.Process() clock.looping_call(self._update_curr_values, 1000 / self.UPDATE_HZ) |