1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#!/bin/bash
#
# Write out gnuplot script for graphing data
# generated by com_commit_monitor.sh.
#
# Redirect the output of this script and run it
# through gnuplot to get the resulting graphic.
#
# Hakan Kuecuekyilmaz, <hakan at askmonty dot org>, 2010-12-16.
#
if [ $# != 3 ]; then
echo "[ERROR]: Please use exactly three arguments"
echo " Usage: $0 [title] [data series file name] [output file name]"
echo " Example: $0 'COM_COMMIT Rate' com_commit.log com_commit_64.png"
exit 1
else
TITLE="$1"
DATA_SERIES_FILE="$2"
OUTPUT_FILE="$3"
fi
echo "set terminal png size 640, 370"
echo "set output \"$OUTPUT_FILE\""
echo "set term png font verdana 7"
echo "set xtics rotate by -45"
echo "set grid ytics"
echo "set tmargin 2"
echo "set rmargin 9"
echo "set bmargin 5"
echo "set lmargin 8"
echo "set xdata time"
echo "set timefmt \"%s\""
echo "set format x \"%H:%M:%S\""
echo "plot '$DATA_SERIES_FILE' using 1:3 title '$TITLE' with lines"
|