Skip to content

Commit

Permalink
Merge pull request #110 from ndokos/wip-fio-postprocess
Browse files Browse the repository at this point in the history
Ignore extra disk-stats array if present.
  • Loading branch information
ndokos committed Nov 24, 2015
2 parents 1e1ded0 + 4eba91b commit 5074425
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions agent/bench-scripts/postprocess/fio-postprocess
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ my $tool_group = $ARGV[2];
my $js_str;

open( JS, "<$dir/fio-result.txt" ) or die "Can't open $dir/fio-result.txt: $!";
# skip past the non json stuff
# there may be more than one json array, and we want only the last one
while ( <JS> ) {
# skip past the non json stuff
if ( /{/ ) {
last;
$js_str = "{\n";
while ( <JS> ) {
$js_str = $js_str . $_;
if ( /^}/ ) {
last;
}
}
}
}

if ( eof JS ) {
print "Could not read rest of json data\n";
exit 1;
} else {
# read the rest of the file in to one string
local $/=undef;
binmode JS;
$js_str = <JS>;
$js_str = "{\n" . $js_str;
if ( ! defined $js_str ) {
print "Could not find any json data, exiting\n";
exit 1
}

# convert [json] string in to big hash
Expand Down

0 comments on commit 5074425

Please sign in to comment.