[PATCH] Time and seek optimizations
[fio.git] / fio_generate_plots
1 #!/bin/bash
2
3 # Use gnuplot to generate plots from fio run with -l and/or -w
4
5 if [ "$1"x == "x" ]; then
6         echo Need title as arg
7         exit 1
8 fi
9
10 GNUPLOT=$(which gnuplot)
11 if [ ! -x $GNUPLOT ]; then
12         echo You need gnuplot installed to generate graphs
13         exit 1
14 fi
15
16 TITLE=$1
17
18 PLOT_LINE=""
19 for i in *bw.log; do
20         if [ ! -r $i ]; then
21                 continue
22         fi
23         if [ "$PLOT_LINE"x != "x" ]; then
24                 PLOT_LINE=$PLOT_LINE", "
25         fi
26
27         PLOT_LINE=$PLOT_LINE"'$i' with lines"
28 done
29
30 if [ "$PLOT_LINE"x != "x" ]; then
31         echo Making bw logs
32         echo "set title 'Bandwidth - $TITLE'; set xlabel 'time (msec)'; set ylabel 'KiB/sec'; set terminal png; set output '$TITLE-bw.png'; plot " $PLOT_LINE | $GNUPLOT -
33 fi
34
35 PLOT_LINE=""
36 for i in *slat.log; do
37         if [ ! -r $i ]; then
38                 continue
39         fi
40         if [ "$PLOT_LINE"x != "x" ]; then
41                 PLOT_LINE=$PLOT_LINE", "
42         fi
43
44         PLOT_LINE=$PLOT_LINE"'$i' with lines"
45 done
46
47 if [ "$PLOT_LINE"x != "x" ]; then
48         echo Making slat logs $PLOT_LINE
49         echo "set title 'Submission latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png; set output '$TITLE-slat.png'; plot " $PLOT_LINE | $GNUPLOT -
50 fi
51
52 PLOT_LINE=""
53 for i in *clat.log; do
54         if [ ! -r $i ]; then
55                 continue
56         fi
57         if [ "$PLOT_LINE"x != "x" ]; then
58                 PLOT_LINE=$PLOT_LINE", "
59         fi
60
61         PLOT_LINE=$PLOT_LINE"'$i' with lines"
62 done
63
64 if [ "$PLOT_LINE"x != "x" ]; then
65         echo Making clat logs $PLOT_LINE
66         echo "set title 'Completion latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png; set output '$TITLE-clat.png'; plot " $PLOT_LINE | $GNUPLOT -
67 fi