summary refs log tree commit diff
path: root/synapse/metrics
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-07-20 17:40:00 +0100
committerRichard van der Hoff <richard@matrix.org>2016-07-20 17:40:00 +0100
commit7314bf4682754050db4b728b77229fd005df7381 (patch)
tree1baf5b1a869a00945303c2d98dc41415dfc37c71 /synapse/metrics
parentGET /devices endpoint (diff)
parentMerge pull request #938 from matrix-org/rav/add_device_id_to_client_ips (diff)
downloadsynapse-7314bf4682754050db4b728b77229fd005df7381.tar.xz
Merge branch 'develop' into rav/get_devices_api
(pick up PR #938 in the hope of fixing the UTs)
Diffstat (limited to 'synapse/metrics')
-rw-r--r--synapse/metrics/metric.py3
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)