Skip to content

Commit f94d18e

Browse files
committed
fix issue with empty prior_values list
1 parent 5823bba commit f94d18e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

dreadnode/metric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def apply_mode(self, mode: MetricAggMode, others: "list[Metric]") -> "Metric":
8787
prior_values = [m.value for m in sorted(others, key=lambda m: m.timestamp)]
8888

8989
if mode == "sum":
90-
self.value += max(prior_values)
90+
self.value = sum([self.value, *prior_values])
9191
elif mode == "min":
9292
self.value = min([self.value, *prior_values])
9393
elif mode == "max":

0 commit comments

Comments
 (0)