Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / dmclock / benchmark / plot_gen.sh
1 #!/bin/bash
2
3 if [ "$1" != "" ]; then
4   output_file="$1"
5 else
6   echo "Please provide the name of the output file"
7   exit
8 fi
9
10 # parameter check -- k-value
11 if [ "$2" != "" ]; then
12   k_way="$2"
13 else
14   echo "Please provide the maximum K_WAY value"
15   exit
16 fi
17 #echo "k-way: $k_way"
18 #exit
19
20 gnuplot << EOF
21
22 # Note you need gnuplot 4.4 for the pdfcairo terminal.
23 clear
24 reset
25
26 set terminal pdfcairo size 7in,5in font "Gill Sans,5" linewidth 1 rounded fontscale .8 noenhanced
27 set output "${output_file}.pdf"
28
29 # starts multiplot
30 set multiplot layout 2,1
31
32 # Line style for axes
33 set style line 80 lt rgb "#808080"
34
35 # Line style for grid
36 set style line 81 lt 0  # dashed
37 set style line 81 lt rgb "#808080"  # grey
38
39 set grid back linestyle 81
40 set border 3 back linestyle 80 
41
42 #set xtics rotate out
43 set style data histogram
44 set style histogram clustered
45
46 set style fill solid border
47 set xlabel 'Heap Timing for different K values'   
48 set ylabel 'Time (nanosec)'        
49 set key top right
50
51 set yrange [0:*]
52
53 # plot 1
54 set title 'Request Addition Time'
55 plot for [COL=2:($k_way + 1)] '${output_file}.dat' using COL:xticlabels(1) title columnheader
56
57 # plot 2
58 set title 'Request Completion Time'
59 plot for [COL=($k_way + 2):(2 * $k_way + 1)] '${output_file}.dat' using COL:xticlabels(1) title columnheader
60 EOF