-
Notifications
You must be signed in to change notification settings - Fork 4
/
generateGraphs.sh
executable file
·90 lines (77 loc) · 2.07 KB
/
generateGraphs.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/sh
# ----
# Script to generate the detail graphs of a BenchmarkSQL run.
#
# Copyright (C) 2016, Denis Lussier
# Copyright (C) 2016, Jan Wieck
# ----
if [ $# -lt 1 ] ; then
echo "usage: $(basename $0) RESULT_DIR [...]" >&2
exit 2
fi
WIDTH=1200
HEIGHT=400
SIMPLE_GRAPHS="tpm_nopm latency cpu_utilization dirty_buffers"
for resdir in $* ; do
cd "${resdir}" || exit 1
for graph in $SIMPLE_GRAPHS ; do
echo -n "Generating ${resdir}/${graph}.png ... "
out=$(sed -e "s/@WIDTH@/${WIDTH}/g" -e "s/@HEIGHT@/${HEIGHT}/g" \
<../misc/${graph}.R | R --no-save)
if [ $? -ne 0 ] ; then
echo "ERROR"
echo "$out" >&2
exit 3
fi
echo "OK"
done
for fname in ./data/blk_*.csv ; do
if [ ! -f "${fname}" ] ; then
continue
fi
devname=$(basename ${fname} .csv)
echo -n "Generating ${resdir}/${devname}_iops.png ... "
out=$(sed -e "s/@WIDTH@/${WIDTH}/g" -e "s/@HEIGHT@/${HEIGHT}/g" \
-e "s/@DEVICE@/${devname}/g" <../misc/blk_device_iops.R | R --no-save)
if [ $? -ne 0 ] ; then
echo "ERROR"
echo "$out" >&2
exit 3
fi
echo "OK"
echo -n "Generating ${resdir}/${devname}_kbps.png ... "
out=$(sed -e "s/@WIDTH@/${WIDTH}/g" -e "s/@HEIGHT@/${HEIGHT}/g" \
-e "s/@DEVICE@/${devname}/g" <../misc/blk_device_kbps.R | R --no-save)
if [ $? -ne 0 ] ; then
echo "ERROR"
echo "$out" >&2
exit 3
fi
echo "OK"
done
for fname in ./data/net_*.csv ; do
if [ ! -f "${fname}" ] ; then
continue
fi
devname=$(basename ${fname} .csv)
echo -n "Generating ${resdir}/${devname}_iops.png ... "
out=$(sed -e "s/@WIDTH@/${WIDTH}/g" -e "s/@HEIGHT@/${HEIGHT}/g" \
-e "s/@DEVICE@/${devname}/g" <../misc/net_device_iops.R | R --no-save)
if [ $? -ne 0 ] ; then
echo "ERROR"
echo "$out" >&2
exit 3
fi
echo "OK"
echo -n "Generating ${resdir}/${devname}_kbps.png ... "
out=$(sed -e "s/@WIDTH@/${WIDTH}/g" -e "s/@HEIGHT@/${HEIGHT}/g" \
-e "s/@DEVICE@/${devname}/g" <../misc/net_device_kbps.R | R --no-save)
if [ $? -ne 0 ] ; then
echo "ERROR"
echo "$out" >&2
exit 3
fi
echo "OK"
done
cd ..
done