Skip to content

Instantly share code, notes, and snippets.

@tnmt
Created August 8, 2013 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnmt/6180789 to your computer and use it in GitHub Desktop.
Save tnmt/6180789 to your computer and use it in GitHub Desktop.
fioの出力をgithub wikiのtable形式にフォーマットする
#!/usr/bin/perl
use strict;
use warnings;
print <<EOT;
- | bandwidth | iops
--------------|-------------|--------
EOT
while ( defined(my $line = <>) ) {
next unless $line =~ /^(.+):.*groupid=/o;
my $group = $1;
my $result = <>;
my ( $bw, $iops ) = $result =~ /bw=(.*?),.*iops=(.*?),/;
printf " %-12s | %11s | %7s\n",
$group,
$bw,
$iops;
}
print "\n";
=head1 NAME
pretty_format.pl
=head1 SYNOPSIS
fio hogehoge | tee /tmp/fio.log | ./pretty_format.pl
=head1 DESCRIPTION
fioの出力をgithub wikiのtable形式にフォーマットする。
=head1 AUTHOR
<kuroda@paperboy.co.jp>
=head1 SEE ALSO
=cut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment