return fio_data_file
def generate_gnuplot_script(fio_data_file,title,gnuplot_output_filename,gnuplot_output_dir,mode,disk_perf,gpm_dir):
+ print "Generating rendering scripts"
filename=gnuplot_output_dir+'mygraph'
f=open(filename,'w')
smooth_filename = "%s-2Dsmooth" % (png_file)
trend_filename = "%s-2Dtrend" % (png_file)
avg = average(disk_perf[pos])
- f.write("call \'%s/graph2D.gpm\' \'%s' \'%s\' \'\' \'%s\' \'%s\' \'%s\' \'%s\' \'%f\'\n" % (gpm_dir,title,tmp_filename,raw_filename,mode,smooth_filename,trend_filename,avg))
+ f.write("call \'%s/graph2D.gpm\' \'%s' \'%s\' \'%s\' \'%s\' \'%s\' \'%s\' \'%s\' \'%f\'\n" % (gpm_dir,title,tmp_filename,fio_data_file[pos],raw_filename,mode,smooth_filename,trend_filename,avg))
pos = pos +1
# Plotting comparing graphs doesn't have a meaning unless if there is at least 2 traces
f.close()
def compute_aggregated_file(fio_data_file, gnuplot_output_filename, gnuplot_output_dir):
+ print "Processing data file 2/2"
temp_files=[]
pos=0
def average(s): return sum(s) * 1.0 / len(s)
def compute_temp_file(fio_data_file,disk_perf,gnuplot_output_dir):
+ print "Processing data file 1/2"
files=[]
temp_outfile=[]
blk_size=0
return blk_size
def compute_math(fio_data_file, title,gnuplot_output_filename,gnuplot_output_dir,mode,disk_perf,gpm_dir):
+ print "Computing Maths"
global_min=[]
global_max=[]
average_file=open(gnuplot_output_dir+gnuplot_output_filename+'.average', 'w')
os.system("cd %s; gnuplot mymath" % gnuplot_output_dir)
print " |-> Rendering 2D & 3D traces"
os.system("cd %s; gnuplot mygraph" % gnuplot_output_dir)
+
+ name_of_directory="the current"
+ if gnuplot_output_dir != "./":
+ name_of_directory=gnuplot_output_dir
+ print "\nRendering traces are available in %s directory" % name_of_directory
except:
print "Could not run gnuplot on mymath or mygraph !\n"
sys.exit(1);
def print_help():
- print 'fio2gnuplot.py -ghbio -t <title> -o <outputfile> -p <pattern>'
+ print 'fio2gnuplot.py -ghbiod -t <title> -o <outputfile> -p <pattern> -G <type>'
print
print '-h --help : Print this help'
print '-p <pattern> or --pattern <pattern> : A pattern in regexp to select fio input files'