state_sim support

This commit is contained in:
Ștefan Talpalaru 2020-08-24 01:33:26 +02:00
parent 7aefef979a
commit e74d4a09f8
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
2 changed files with 40 additions and 0 deletions

View File

@ -47,6 +47,43 @@ if ($bench_type eq 'block_sim') {
$start_processing = 1 if /^Done!$/;
next if not $start_processing;
if (/^Validators: (\d+), epoch length: (\d+)$/) {
($validators, $epoch_length) = ($1, $2);
} elsif (/^(\d+\.\d+),\s+(\d+\.\d+),\s+(\d+\.\d+),\s+(\d+\.\d+),\s+(\d+), (.+)$/) {
my ($average, $stddev, $min, $max, $samples, $test_name) = ($1, $2, $3, $4, $5, $6);
my %test = (
name => $test_name,
);
@{$test{'parameters'}} = (
{
name => 'validators',
value => $validators * 1,
},
{
name => 'epoch length',
value => $epoch_length * 1,
},
);
@{$test{'results'}} = (
{
name => 'average',
value => $average * 1,
},
);
push(@{$group{'tests'}}, \%test);
}
}
} elsif ($bench_type eq 'state_sim') {
my $start_processing = 0;
my $validators = 0;
my $epoch_length = 0;
while (<$input_handle>) {
# strip both ends
s/^\s+|\s+$//;
$start_processing = 1 if /^:Done!$/;
next if not $start_processing;
if (/^Validators: (\d+), epoch length: (\d+)$/) {
($validators, $epoch_length) = ($1, $2);
} elsif (/^(\d+\.\d+),\s+(\d+\.\d+),\s+(\d+\.\d+),\s+(\d+\.\d+),\s+(\d+), (.+)$/) {

View File

@ -17,6 +17,9 @@ BENCHMARKS=()
if [[ -f "research/block_sim.nim" ]]; then
BENCHMARKS+=( block_sim )
fi
if [[ -f "research/state_sim.nim" ]]; then
BENCHMARKS+=( state_sim )
fi
make -j${NPROC} ${BENCHMARKS[*]}