fio2gnuplot: Don't graph 3D if not enough data
authorErwan Velu <erwan@enovance.com>
Fri, 12 Jul 2013 12:24:26 +0000 (14:24 +0200)
committerErwan Velu <erwan@enovance.com>
Fri, 12 Jul 2013 12:24:26 +0000 (14:24 +0200)
If the matching pattern doesn't get more than a single file, 3D plotting
doesn't have any meaning and confuse gnuplot.

So let's disable the 3D plotting if a single file matched the pattern.

tools/plot/fio2gnuplot.py

index c1a5cfb0a1d94ed6a5016abb51af95a571a14bd1..ef32ee0b156dac047cef5ee0cd71fd60214b35fa 100755 (executable)
@@ -39,7 +39,8 @@ def find_file(path, pattern):
 
 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))
+       if len(fio_data_file) > 1:
+               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