Add code for parsing FFmpeg's send benchmark output
This commit is contained in:
parent
2f8db432be
commit
aca3932cb9
|
|
@ -23,14 +23,18 @@ sub open_file {
|
||||||
return $fh;
|
return $fh;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub parse_uvgrtp_send {
|
sub parse_generic_send {
|
||||||
my ($iter, $threads, $path) = @_;
|
my ($lib, $iter, $threads, $path) = @_;
|
||||||
|
|
||||||
my ($t_usr, $t_sys, $t_cpu, $t_total, $t_time);
|
my ($t_usr, $t_sys, $t_cpu, $t_total, $t_time);
|
||||||
my ($t_sgp, $t_tgp, $lines);
|
my ($t_sgp, $t_tgp, $fh, $lines);
|
||||||
|
|
||||||
my $e = ($iter * ($threads + 2));
|
if ($lib eq "uvgrtp") {
|
||||||
my $fh = open_file($path, $e);
|
my $e = ($iter * ($threads + 2));
|
||||||
|
$fh = open_file($path, $e);
|
||||||
|
} else {
|
||||||
|
open $fh, '<', $path or die "failed to open file\n";
|
||||||
|
}
|
||||||
|
|
||||||
# each iteration parses one benchmark run
|
# each iteration parses one benchmark run
|
||||||
# and each benchmark run can have 1..N entries, one for each thread
|
# and each benchmark run can have 1..N entries, one for each thread
|
||||||
|
|
@ -38,6 +42,8 @@ sub parse_uvgrtp_send {
|
||||||
my $rt_avg = 0;
|
my $rt_avg = 0;
|
||||||
my $rb_avg = 0;
|
my $rb_avg = 0;
|
||||||
|
|
||||||
|
next if index ($line, "kB") == -1 or index ($line, "MB") == -1;
|
||||||
|
|
||||||
# for multiple threads there are two numbers:
|
# for multiple threads there are two numbers:
|
||||||
# - single thread performance
|
# - single thread performance
|
||||||
# -> for each thread, calculate the speed at which the data was sent,
|
# -> for each thread, calculate the speed at which the data was sent,
|
||||||
|
|
@ -159,12 +165,16 @@ if ($help == 1) {
|
||||||
|
|
||||||
if ($lib eq "uvgrtp") {
|
if ($lib eq "uvgrtp") {
|
||||||
if ($role eq "send") {
|
if ($role eq "send") {
|
||||||
parse_uvgrtp_send($iter, $threads, $path);
|
parse_generic_send($lib, $iter, $threads, $path);
|
||||||
} else {
|
} else {
|
||||||
parse_uvgrtp_recv($iter, $threads, $path);
|
parse_uvgrtp_recv($iter, $threads, $path);
|
||||||
}
|
}
|
||||||
} elsif ($lib eq "ffmpeg") {
|
} elsif ($lib eq "ffmpeg") {
|
||||||
die "not implemented";
|
if ($role eq "send") {
|
||||||
|
parse_generic_send($lib, $iter, $threads, $path);
|
||||||
|
} else {
|
||||||
|
die "not implemented";
|
||||||
|
}
|
||||||
} elsif ($lib eq "gstreamer") {
|
} elsif ($lib eq "gstreamer") {
|
||||||
die "not implemented";
|
die "not implemented";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue