Skip to content

Commit

Permalink
Better debug log print
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Sonnino committed Jul 6, 2021
1 parent 3dd9a55 commit 716f23d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
12 changes: 8 additions & 4 deletions narwhal/benchmark/benchmark/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ def __init__(self, clients, primaries, workers, faults=0):
assert all(x for x in inputs)

self.faults = faults
self.committee_size = len(primaries) + faults
self.workers = len(workers) // len(primaries)
if isinstance(faults, int):
self.committee_size = len(primaries) + int(faults)
self.workers = len(workers) // len(primaries)
else:
self.committee_size = '?'
self.workers = '?'

# Parse the clients logs.
try:
Expand Down Expand Up @@ -203,8 +207,8 @@ def result(self):
' SUMMARY:\n'
'-----------------------------------------\n'
' + CONFIG:\n'
f' Faults: {self.faults:,} node(s)\n'
f' Committee size: {self.committee_size:,} node(s)\n'
f' Faults: {self.faults} node(s)\n'
f' Committee size: {self.committee_size} node(s)\n'
f' Worker(s) per node: {self.workers} worker(s)\n'
f' Collocate primary and workers: {self.collocate}\n'
f' Input rate: {sum(self.rate):,} tx/s\n'
Expand Down
20 changes: 10 additions & 10 deletions narwhal/benchmark/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ def install(ctx):
def remote(ctx, debug=False):
''' Run benchmarks on AWS '''
bench_params = {
'faults': 0,
'nodes': [4],
'workers': 7,
'collocate': False,
'rate': [500_000],
'faults': 3,
'nodes': [10],
'workers': 1,
'collocate': True,
'rate': [10_000, 110_000],
'tx_size': 512,
'duration': 300,
'runs': 2,
Expand All @@ -122,10 +122,10 @@ def remote(ctx, debug=False):
def plot(ctx):
''' Plot performance using the logs generated by "fab remote" '''
plot_params = {
'faults': [0],
'nodes': [4],
'workers': [4, 7],
'collocate': False,
'faults': [0, 1, 3],
'nodes': [10],
'workers': [1],
'collocate': True,
'tx_size': 512,
'max_latency': [3_500, 4_500]
}
Expand All @@ -148,6 +148,6 @@ def kill(ctx):
def logs(ctx):
''' Print a summary of the logs '''
try:
print(LogParser.process('./logs').result())
print(LogParser.process('./logs', faults='?').result())
except ParseError as e:
Print.error(BenchError('Failed to parse logs', e))

0 comments on commit 716f23d

Please sign in to comment.