calcualate tta based on successCondition

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2023-04-13 23:28:40 +02:00
parent ea93e9412f
commit 9855f1b8c4
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E
1 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,7 @@
#!/bin/python3 #!/bin/python3
import os import os
import bisect
from xml.dom import minidom from xml.dom import minidom
from dicttoxml import dicttoxml from dicttoxml import dicttoxml
@ -20,12 +21,11 @@ class Result:
"""It populates part of the result data inside a vector.""" """It populates part of the result data inside a vector."""
self.shape = shape self.shape = shape
self.missingVector = missingVector self.missingVector = missingVector
missingSamples = missingVector[-1] v = self.metrics["progress"]["validators ready"]
validatorsReady = self.metrics["progress"]["validators ready"][-1] tta = bisect.bisect(v, config.successCondition)
#print("There are %05.3f%% validators ready" % (validatorsReady*100)) if tta != len(v):
if validatorsReady > config.successCondition:
self.blockAvailable = 1 self.blockAvailable = 1
self.tta = len(missingVector) * (config.stepDuration) self.tta = tta * (config.stepDuration)
else: else:
self.blockAvailable = 0 self.blockAvailable = 0
self.tta = -1 self.tta = -1