From 67b7db1e6847072b25dfd42d1918ecae20ef23d7 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Fri, 12 Jul 2013 11:12:10 +0200 Subject: [PATCH] fio2gnuplot: Adding 2D graphs for each fio trace 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 | 17 +++++++++++++++-- tools/plot/graph2D.gpm | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 tools/plot/graph2D.gpm diff --git a/tools/plot/fio2gnuplot.py b/tools/plot/fio2gnuplot.py index 8a938cc2..c1a5cfb0 100755 --- a/tools/plot/fio2gnuplot.py +++ b/tools/plot/fio2gnuplot.py @@ -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 index 00000000..74d042a0 --- /dev/null +++ b/tools/plot/graph2D.gpm @@ -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 -- 2.25.1