mirror of
https://github.com/status-im/das-research.git
synced 2025-02-23 11:58:14 +00:00
Adding failure rate logging
This commit is contained in:
parent
d723cb1bc5
commit
beabafba45
@ -89,7 +89,6 @@ class Simulator:
|
||||
self.steps = 0
|
||||
while(missingSamples > 0):
|
||||
oldMissingSamples = missingSamples
|
||||
self.logger.info("Step %d:" % self.steps, extra=self.format)
|
||||
for i in range(1,self.numberValidators):
|
||||
self.validators[i].receiveRowsColumns()
|
||||
for i in range(1,self.numberValidators):
|
||||
@ -102,7 +101,8 @@ class Simulator:
|
||||
|
||||
arrived, expected = self.glob.checkStatus(self.validators)
|
||||
missingSamples = expected - arrived
|
||||
self.logger.info("step %d, missing %d of %d" % (self.steps, missingSamples, expected), extra=self.format)
|
||||
missingRate = missingSamples*100/expected
|
||||
self.logger.info("step %d, missing %d of %d (%0.02f %%)" % (self.steps, missingSamples, expected, missingRate), extra=self.format)
|
||||
if missingSamples == oldMissingSamples:
|
||||
break
|
||||
elif missingSamples == 0:
|
||||
|
@ -68,10 +68,13 @@ class Validator:
|
||||
random.shuffle(order)
|
||||
while(order):
|
||||
i = order.pop()
|
||||
if (random.randint(0,99) > self.failureRate):
|
||||
if (random.randint(0,99) >= self.failureRate):
|
||||
self.block.data[i] = 1
|
||||
else:
|
||||
self.block.data[i] = 0
|
||||
nbFailures = self.block.data.count(0)
|
||||
measuredFailureRate = nbFailures * 100 / (self.blockSize * self.blockSize)
|
||||
self.logger.info("Number of failures: %d (%0.02f %%)", nbFailures, measuredFailureRate, extra=self.format)
|
||||
#broadcasted.print()
|
||||
for id in range(self.blockSize):
|
||||
self.sendColumn(id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user