fio2gnuplot: Adding 2D graphs for each fio trace
authorErwan Velu <erwan@enovance.com>
Fri, 12 Jul 2013 09:12:10 +0000 (11:12 +0200)
committerErwan Velu <erwan@enovance.com>
Fri, 12 Jul 2013 09:47:07 +0000 (11:47 +0200)
When tracing multiple files, the 3D graph is useful to understand the
behavior of a group of disks but makes difficult to understand how a
particular disk behave during the test.

This patch does add three 2D plots for each fio trace :
- the 2D Raw tracing
This plot is the exact plotting of the raw values reported by fio.
It's very precise but hard to read when having many many traces

- the 2D Smooth tracing
This plot is a smooth version of the raw tracing. It tries to keep as
much as possible a tracing close to the raw one but makes it more
readable by aggregating points.

- the 2D Trend tracing
This plot is trying to setup a trend of the global performance. It
aggregates many points and hide peaks. It only consider at giving a very
easy to understand plotting on how the bench was performing.
It's much more easier to read but could be misleading if raw or smooth
tracing didn't got read before.

tools/plot/fio2gnuplot.py
tools/plot/graph2D.gpm [new file with mode: 0644]

index 8a938cc258214324aa9a638aff87e30bbade51e9..c1a5cfb0a1d94ed6a5016abb51af95a571a14bd1 100755 (executable)
@@ -37,9 +37,22 @@ def find_file(path, pattern):
 
        return fio_data_file
 
-def generate_gnuplot_script(title,gnuplot_output_filename,mode):
+def generate_gnuplot_script(fio_data_file,title,gnuplot_output_filename,mode,disk_perf):
        f=open("mygraph",'w')
         f.write("call \'graph3D.gpm\' \'%s' \'%s\' \'\' \'%s\' \'%s\'\n" % (title,gnuplot_output_filename,gnuplot_output_filename,mode))
+
+        pos=0
+        # Let's create a temporary file for each selected fio file
+        for file in fio_data_file:
+                tmp_filename = "gnuplot_temp_file.%d" % pos
+                png_file=file.replace('.log','')
+                raw_filename = "%s-2Draw" % (png_file)
+                smooth_filename = "%s-2Dsmooth" % (png_file)
+                trend_filename = "%s-2Dtrend" % (png_file)
+                avg  = average(disk_perf[pos])
+                f.write("call \'graph2D.gpm\' \'%s' \'%s\' \'\' \'%s\' \'%s\' \'%s\' \'%s\' \'%f\'\n" % (title,tmp_filename,raw_filename,mode,smooth_filename,trend_filename,avg))
+                pos = pos +1
+
        f.close()
 
 def generate_gnuplot_math_script(title,gnuplot_output_filename,mode,average):
@@ -330,7 +343,7 @@ def main(argv):
        title="%s @ Blocksize = %dK" % (title,blk_size/1024)
        compute_aggregated_file(fio_data_file, gnuplot_output_filename)
        compute_math(fio_data_file,title,gnuplot_output_filename,mode,disk_perf)
-       generate_gnuplot_script(title,gnuplot_output_filename,mode)
+       generate_gnuplot_script(fio_data_file,title,gnuplot_output_filename,mode,disk_perf)
 
        if (run_gnuplot==True):
                render_gnuplot()
diff --git a/tools/plot/graph2D.gpm b/tools/plot/graph2D.gpm
new file mode 100644 (file)
index 0000000..74d042a
--- /dev/null
@@ -0,0 +1,34 @@
+# This Gnuplot file has been generated by eNovance
+
+set title '$0'
+
+set terminal png size 1280,1024
+set output '$3.png'
+#set terminal x11
+
+#Preparing Axes
+#set logscale x
+set ytics axis out 0,5
+#set data style lines
+set key top left reverse
+set xlabel "Time (Seconds)"
+set ylabel '$4'
+set xrange [0:]
+set yrange [0:]
+
+#Set Color style
+#set palette rgbformulae 22,9,23
+#set palette rgbformulae 7,5,15
+set style line 100 lt 7 lw 0.5
+set style line 1 lt 1 lw 3 pt 3 linecolor rgb "green"
+
+plot '$1' using 2:3 with linespoints title '$2', $7 w l ls 1 ti 'Global average value'
+
+set output '$5.png'
+plot '$1' using 2:3 smooth csplines title '$2', $7 w l ls 1 ti 'Global average value'
+
+set output '$6.png'
+plot '$1' using 2:3 smooth bezier title '$2', $7 w l ls 1 ti 'Global average value'
+
+#pause -1
+#The End