From 9855f1b8c4550cb00c40c944b987f56b354b0f1e Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Thu, 13 Apr 2023 23:28:40 +0200 Subject: [PATCH] calcualate tta based on successCondition Signed-off-by: Csaba Kiraly --- DAS/results.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DAS/results.py b/DAS/results.py index c6a87f1..60cfc81 100644 --- a/DAS/results.py +++ b/DAS/results.py @@ -1,6 +1,7 @@ #!/bin/python3 import os +import bisect from xml.dom import minidom from dicttoxml import dicttoxml @@ -20,12 +21,11 @@ class Result: """It populates part of the result data inside a vector.""" self.shape = shape self.missingVector = missingVector - missingSamples = missingVector[-1] - validatorsReady = self.metrics["progress"]["validators ready"][-1] - #print("There are %05.3f%% validators ready" % (validatorsReady*100)) - if validatorsReady > config.successCondition: + v = self.metrics["progress"]["validators ready"] + tta = bisect.bisect(v, config.successCondition) + if tta != len(v): self.blockAvailable = 1 - self.tta = len(missingVector) * (config.stepDuration) + self.tta = tta * (config.stepDuration) else: self.blockAvailable = 0 self.tta = -1