diff options
author | Erik Johnston <erik@matrix.org> | 2016-07-20 16:59:52 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-07-20 16:59:52 +0100 |
commit | d36b1d849d5d896967ab2ade7c206513e502d94f (patch) | |
tree | b1d41b409be16a85a6717a78d9ac4cf82ede9534 | |
parent | Merge pull request #937 from matrix-org/rav/register_device_on_register (diff) | |
download | synapse-d36b1d849d5d896967ab2ade7c206513e502d94f.tar.xz |
Don't explode if we have no snapshots yet
Diffstat (limited to '')
-rw-r--r-- | synapse/metrics/metric.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/metrics/metric.py b/synapse/metrics/metric.py index d100841a7f..7becbe0491 100644 --- a/synapse/metrics/metric.py +++ b/synapse/metrics/metric.py @@ -180,6 +180,9 @@ class MemoryUsageMetric(object): self.memory_snapshots[:] = self.memory_snapshots[-max_size:] def render(self): + if not self.memory_snapshots: + return [] + max_rss = max(self.memory_snapshots) min_rss = min(self.memory_snapshots) sum_rss = sum(self.memory_snapshots) |