From 8a44299b0072a8bedd1c0d74f92d258379c8447a Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Mon, 6 Jan 2020 12:57:33 +0100 Subject: Increase freshness threshold in tests --- src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent/modules') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java index 6c0f380..6761c94 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java @@ -94,6 +94,8 @@ public class Stanik extends Module { private boolean pruneZMI(ZMI zmi, ValueTime time) { Value timestamp = zmi.getAttributes().get("timestamp"); + boolean isLeaf = zmi.getSons().isEmpty(); + List sonsToRemove = new LinkedList(); if (ValueUtils.valueLower(timestamp, time.subtract(new ValueDuration(freshnessPeriod)))) { if (zmi.getFather() != null) { @@ -111,7 +113,7 @@ public class Stanik extends Module { zmi.removeSon(son); } - if (zmi.getSons().isEmpty()) { + if (!isLeaf && zmi.getSons().isEmpty()) { return true; } -- cgit v1.2.3