Commit | Line | Data |
---|---|---|
40cfddb4 | 1 | #! /bin/sh |
ebac4655 JA |
2 | |
3 | # Use gnuplot to generate plots from fio run with -l and/or -w | |
4 | ||
40cfddb4 | 5 | if [ "$1"x = "x" ]; then |
ebac4655 JA |
6 | echo Need title as arg |
7 | exit 1 | |
8 | fi | |
9 | ||
1618495b JA |
10 | GNUPLOT=$(which gnuplot) |
11 | if [ ! -x $GNUPLOT ]; then | |
12 | echo You need gnuplot installed to generate graphs | |
13 | exit 1 | |
14 | fi | |
15 | ||
ebac4655 JA |
16 | TITLE=$1 |
17 | ||
18 | PLOT_LINE="" | |
19 | for i in *bw.log; do | |
20 | if [ ! -r $i ]; then | |
21 | continue | |
22 | fi | |
84f83179 | 23 | PT=$(echo $i | sed s/_bw.log//g) |
ebac4655 JA |
24 | if [ "$PLOT_LINE"x != "x" ]; then |
25 | PLOT_LINE=$PLOT_LINE", " | |
26 | fi | |
27 | ||
84f83179 | 28 | PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines" |
ebac4655 JA |
29 | done |
30 | ||
31 | if [ "$PLOT_LINE"x != "x" ]; then | |
32 | echo Making bw logs | |
b22989b9 | 33 | echo "set title 'Bandwidth - $TITLE'; set xlabel 'time (msec)'; set ylabel 'KB/sec'; set terminal png; set output '$TITLE-bw.png'; plot " $PLOT_LINE | $GNUPLOT - |
ebac4655 JA |
34 | fi |
35 | ||
36 | PLOT_LINE="" | |
37 | for i in *slat.log; do | |
38 | if [ ! -r $i ]; then | |
39 | continue | |
40 | fi | |
84f83179 | 41 | PT=$(echo $i | sed s/_slat.log//g) |
ebac4655 JA |
42 | if [ "$PLOT_LINE"x != "x" ]; then |
43 | PLOT_LINE=$PLOT_LINE", " | |
44 | fi | |
45 | ||
84f83179 | 46 | PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines" |
ebac4655 JA |
47 | done |
48 | ||
49 | if [ "$PLOT_LINE"x != "x" ]; then | |
50 | echo Making slat logs $PLOT_LINE | |
1618495b | 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 - |
ebac4655 JA |
52 | fi |
53 | ||
54 | PLOT_LINE="" | |
55 | for i in *clat.log; do | |
56 | if [ ! -r $i ]; then | |
57 | continue | |
58 | fi | |
84f83179 | 59 | PT=$(echo $i | sed s/_clat.log//g) |
ebac4655 JA |
60 | if [ "$PLOT_LINE"x != "x" ]; then |
61 | PLOT_LINE=$PLOT_LINE", " | |
62 | fi | |
63 | ||
84f83179 | 64 | PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines" |
ebac4655 JA |
65 | done |
66 | ||
67 | if [ "$PLOT_LINE"x != "x" ]; then | |
68 | echo Making clat logs $PLOT_LINE | |
1618495b | 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 - |
ebac4655 | 70 | fi |
02af0988 JA |
71 | |
72 | PLOT_LINE="" | |
73 | for i in *_lat.log; do | |
74 | if [ ! -r $i ]; then | |
75 | continue | |
76 | fi | |
77 | PT=$(echo $i | sed s/_lat.log//g) | |
78 | if [ "$PLOT_LINE"x != "x" ]; then | |
79 | PLOT_LINE=$PLOT_LINE", " | |
80 | fi | |
81 | ||
82 | PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines" | |
83 | done | |
84 | ||
85 | if [ "$PLOT_LINE"x != "x" ]; then | |
86 | echo Making lat logs $PLOT_LINE | |
87 | echo "set title 'Latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png; set output '$TITLE-lat.png'; plot " $PLOT_LINE | $GNUPLOT - | |
88 | fi |