mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Don't explode if we have no snapshots yet
This commit is contained in:
parent
742056be0d
commit
d36b1d849d
@ -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 New Issue
Block a user