#
# Author: Jitendra Pawar <jitendra@clusterfs.com>
-# Report generation for plot-obdfilter
+# Report generation for iokit-plot-obdfilter
# ====================================
-# The plot-obdfilter script is used to generate csv file and
+# The iokit-plot-obdfilter script is used to generate csv file and
# instructions files for gnuplot from the output of obdfilter-survey script.
#
-# The plot-obdfilter also creates .scr file that contains instructions
+# The iokit-plot-obdfilter also creates .scr file that contains instructions
# for gnuplot to plot the graph. After generating .dat and .scr files this
# script invokes gnuplot to display graph.
#
# Syntax:
# $ obdfilter-survey > log_filename
-# $ plot-obdfilter <log_filename>
+# $ iokit-plot-obdfilter <log_filename>
# [Note: 1. Please use the .summary file generated by obdfilter-survey as log_file.
# It is generally available at /tmp/obdfilter_survey_<date_time_system>.summary
# 2. This script may need modifications whenever there will be
my $rwlabel = $_[1];
print "generating plot $file-$rsz-$op.png\n";
open ( SCRFILE, "> $file-$rsz-$op.scr" ) or die "Can't open scr file for writing";
-
+
if ($subtitle) {
print SCRFILE "set title \"@GraphTitle\\n$rwlabel, Rsize = $rsz KBytes, $subtitle\"\n";
} else {
print SCRFILE "set ylabel \"Speeds(MB/s)\"\n";
print SCRFILE "set logscale x\n";
print SCRFILE "set grid\n";
- print SCRFILE "set terminal png\n";
- print SCRFILE "set output \"/dev/null\"\n";
+ print SCRFILE "set terminal png\n";
+ print SCRFILE "set output \"/dev/null\"\n";
if ($opt_y0 != -9999) {
print SCRFILE "set yrange [ $opt_y0: ]\n";
- }
+ }
my $plot = "plot";
$i = 2;
$xrange = 1;
} else {
printf DATAFILE "%-10s", "-";
}
- }
+ }
}
}
close DATAFILE;
$graphgen = 0;
# Command line parameter parsing
use Getopt::Long;
-GetOptions ('help' => \$opt_help, 'st=s' => \$subtitle, 'y0=i' => \$opt_y0) or usage();
+GetOptions ('help' => \$opt_help, 'st=s' => \$subtitle, 'y0=i' => \$opt_y0) or usage();
if ($opt_help) {
usage();
}
$linelen = @line;
if ($linelen > 26 || $linelen < 11) {
print "invalid file format at line $count\n";
- exit 1;
- }
+ exit 1;
+ }
if (!$rsz && $line[5]) {
$cnt = 0;
$rsz = $line[5];
if ($line[$i]) {
$operations[$cnt] = $line[$i];
$cnt++;
- }
+ }
}
}
if ($rsz ne $line[5]) {
$rsz = $line[5];
$first_obj = $line[7];
$first_thread = $line[9];
- @operations = ();
+ @operations = ();
$cnt = 0;
for ($i = 10; $i <= $linelen; $i = $i + 5) {
if ($line[$i]) {
$operations[$cnt] = $line[$i];
$cnt++;
- }
+ }
}
$obj = 0;
$thread = 0;
$arwr{$line[9]}{$line[7]} = $line[$i * 5 + 11];
} elsif ($operations[$i] eq "rewrite_again") {
$arwa{$line[9]}{$line[7]} = $line[$i * 5 + 11];
- }
+ }
}
if ( $obj < $line[9] ) {
$obj = $line[9];