mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-19 08:24:25 +01:00
Don't explode if we have no snapshots yet
This commit is contained in:
parent
742056be0d
commit
d36b1d849d
1 changed files with 3 additions and 0 deletions
|
@ -180,6 +180,9 @@ class MemoryUsageMetric(object):
|
||||||
self.memory_snapshots[:] = self.memory_snapshots[-max_size:]
|
self.memory_snapshots[:] = self.memory_snapshots[-max_size:]
|
||||||
|
|
||||||
def render(self):
|
def render(self):
|
||||||
|
if not self.memory_snapshots:
|
||||||
|
return []
|
||||||
|
|
||||||
max_rss = max(self.memory_snapshots)
|
max_rss = max(self.memory_snapshots)
|
||||||
min_rss = min(self.memory_snapshots)
|
min_rss = min(self.memory_snapshots)
|
||||||
sum_rss = sum(self.memory_snapshots)
|
sum_rss = sum(self.memory_snapshots)
|
||||||
|
|
Loading…
Reference in a new issue