add scripts for running a throughput test between two machines
Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
ed5f89b143
commit
97990237bc
4 changed files with 212 additions and 0 deletions
60
performance/throughput-test-extract
Executable file
60
performance/throughput-test-extract
Executable file
|
@ -0,0 +1,60 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
my @dirs = ("async0-mode-1", "async0-mode0", "async0-mode1",
|
||||
"async1-mode-1", "async1-mode0", "async1-mode1");
|
||||
|
||||
my $dataset = 0;
|
||||
my $basedir = "throughput-result";
|
||||
for my $dir (@dirs) {
|
||||
my @loads = ();
|
||||
|
||||
{
|
||||
open LH, "< $basedir/data-$dir/sub-ethload.log" or die "can't open $basedir/data-$dir/sub-ethload.log";
|
||||
my @curload = ();
|
||||
while (<LH>) {
|
||||
die unless /^r +([0-9.]+).*\( *(\d+)/;
|
||||
push @curload, $2 if $1 > 20;
|
||||
if (@curload && $1 < 20) {
|
||||
push @loads, median (@curload);
|
||||
@curload = ();
|
||||
}
|
||||
}
|
||||
push @loads, median (@curload) if @curload;
|
||||
close LH;
|
||||
}
|
||||
|
||||
open FH, "< $basedir/data-$dir/sub.log" or die "can't open $basedir/data-$dir/sub.log";
|
||||
print "\n\n" if $dataset++;
|
||||
print "# mode $dir\n";
|
||||
print "# payloadsize rate[samples/s] appl.bandwidth[Mb/s] raw.bandwidth[Mb/s]\n";
|
||||
my $psz;
|
||||
my @rate = ();
|
||||
while (<FH>) {
|
||||
next unless /Payload size: ([0-9]+).*Transfer rate: ([0-9.]+)/;
|
||||
my $psz_cur = $1; my $rate_cur = $2;
|
||||
$psz = $psz_cur unless defined $psz;
|
||||
if ($psz != $psz_cur) {
|
||||
# this is a bit yucky: scan the ethload for the next set of substantially-above-zero numbers
|
||||
# where "substantially-above-zero" is defined as > 20%, cos that seems to work fine on a
|
||||
# quiescent network
|
||||
my $load = shift @loads;
|
||||
my $rate = median (@rate);
|
||||
printf "%d %f %f %f\n", $psz, $rate, $rate * (8 + $psz) / 125e3, $load / 125e3;
|
||||
@rate = ();
|
||||
}
|
||||
$psz = $psz_cur;
|
||||
push @rate, ($rate_cur + 0.0);
|
||||
}
|
||||
my $load = shift @loads;
|
||||
my $rate = median (@rate);
|
||||
printf "%d %f %f %f\n", $psz, $rate, $rate * (8 + $psz) / 125e3, $load / 125e3;
|
||||
close FH;
|
||||
}
|
||||
|
||||
sub median {
|
||||
my @xs = sort { $a <=> $b } @_;
|
||||
return (@xs % 2) ? $xs[(@xs - 1) / 2] : ($xs[@xs/2 - 1] + $xs[@xs/2]) / 2;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue