pre_read fixes
[fio.git] / fio_generate_plots
... / ...
CommitLineData
1#!/bin/bash
2
3# Use gnuplot to generate plots from fio run with -l and/or -w
4
5if [ "$1"x == "x" ]; then
6 echo Need title as arg
7 exit 1
8fi
9
10GNUPLOT=$(which gnuplot)
11if [ ! -x $GNUPLOT ]; then
12 echo You need gnuplot installed to generate graphs
13 exit 1
14fi
15
16TITLE=$1
17
18PLOT_LINE=""
19for i in *bw.log; do
20 if [ ! -r $i ]; then
21 continue
22 fi
23 PT=$(echo $i | sed s/_bw.log//g)
24 if [ "$PLOT_LINE"x != "x" ]; then
25 PLOT_LINE=$PLOT_LINE", "
26 fi
27
28 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
29done
30
31if [ "$PLOT_LINE"x != "x" ]; then
32 echo Making bw logs
33 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 -
34fi
35
36PLOT_LINE=""
37for i in *slat.log; do
38 if [ ! -r $i ]; then
39 continue
40 fi
41 PT=$(echo $i | sed s/_slat.log//g)
42 if [ "$PLOT_LINE"x != "x" ]; then
43 PLOT_LINE=$PLOT_LINE", "
44 fi
45
46 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
47done
48
49if [ "$PLOT_LINE"x != "x" ]; then
50 echo Making slat logs $PLOT_LINE
51 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 -
52fi
53
54PLOT_LINE=""
55for i in *clat.log; do
56 if [ ! -r $i ]; then
57 continue
58 fi
59 PT=$(echo $i | sed s/_clat.log//g)
60 if [ "$PLOT_LINE"x != "x" ]; then
61 PLOT_LINE=$PLOT_LINE", "
62 fi
63
64 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
65done
66
67if [ "$PLOT_LINE"x != "x" ]; then
68 echo Making clat logs $PLOT_LINE
69 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 -
70fi