-
Notifications
You must be signed in to change notification settings - Fork 4
/
generateReport.sh
executable file
·320 lines (277 loc) · 7.09 KB
/
generateReport.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
#!/bin/sh
if [ $# -ne 1 ] ; then
echo "usage: $(basename $0) RESULT_DIR" >&2
exit 2
fi
TABLE_WIDTH="1100px"
function getRunInfo()
{
exec 3< data/runInfo.csv
read hdrs <&3
hdrs=$(echo ${hdrs} | tr ',' ' ')
IFS=, read $hdrs <&3
exec <&3-
eval echo "\$$1"
}
function getRunInfoColumns()
{
exec 3< data/runInfo.csv
read hdrs <&3
hdrs=$(echo ${hdrs} | tr ',' ' ')
exec <&3-
echo "${hdrs}"
}
function getProp()
{
grep "^${1}=" run.properties | sed -e "s/^${1}=//"
}
./generateGraphs.sh "${1}"
cd "${1}"
echo -n "Generating ${1}/report.html ... "
# ----
# Start the report.
# ----
cat >report.html <<_EOF_
<html>
<head>
<title>
BenchmarkSQL Run #$(getRunInfo run) started $(getRunInfo sessionStart)
</title>
<style>
h1,h2,h3,h4 { color:#2222AA;
}
h1 { font-family: Helvetica,Arial;
font-weight: 700;
font-size: 24pt;
}
h2 { font-family: Helvetica,Arial;
font-weight: 700;
font-size: 18pt;
}
h3,h4 { font-family: Helvetica,Arial;
font-weight: 700;
font-size: 16pt;
}
p,li,dt,dd { font-family: Helvetica,Arial;
font-size: 14pt;
}
p { margin-left: 50px;
}
pre { font-family: Courier,Fixed;
font-size: 14pt;
}
samp { font-family: Courier,Fixed;
font-weight: 900;
font-size: 14pt;
}
big { font-weight: 900;
font-size: 120%;
}
</style>
</head>
<body bgcolor="#ffffff">
<h1>
BenchmarkSQL Run #$(getRunInfo run) started $(getRunInfo sessionStart)
</h1>
<p>
This TPC-C style benchmark run was performed by the "$(getRunInfo driver)"
driver of BenchmarkSQL version $(getRunInfo driverVersion).
</p>
_EOF_
# ----
# Show the run properties.
# ----
cat >>report.html <<_EOF_
<h2>
Run Properties
</h2>
<p>
<table width="${TABLE_WIDTH}" border="0">
<tr><td bgcolor="#f0f0f0">
<pre><small>
_EOF_
sed -e 's/^password=.*/password=\*\*\*\*\*\*/' <run.properties >>report.html
cat >>report.html <<_EOF_
</small></pre>
</td></tr>
</table>
</p>
_EOF_
# ----
# Show the result summary.
# ----
cat >>report.html <<_EOF_
<h2>
Result Summary
</h2>
_EOF_
if [ $(getRunInfo driver) == "simple" ] ; then
cat >> report.html <<_EOF_
<p>
Note that the "simple" driver is not a true TPC-C implementation.
This driver only measures the database response time, not the
response time of a System under Test as it would be experienced
by an end-user in a 3-tier test implementation.
</p>
_EOF_
fi
cat >> report.html <<_EOF_
<p>
<table width="${TABLE_WIDTH}" border="2">
<tr>
<th rowspan="2" width="16%"><b>Transaction<br/>Type</b></th>
<th colspan="2" width="24%"><b>Latency</b></th>
<th rowspan="2" width="12%"><b>Count</b></th>
<th rowspan="2" width="12%"><b>Percent</b></th>
<th rowspan="2" width="12%"><b>Rollback</b></th>
<th rowspan="2" width="12%"><b>Errors</b></th>
<th rowspan="2" width="12%"><b>Skipped<br/>Deliveries</b></th>
</tr>
<tr>
<th width="12%"><b>90th %</b></th>
<th width="12%"><b>Maximum</b></th>
</tr>
_EOF_
tr ',' ' ' <data/tx_summary.csv | \
while read name count percent ninth max limit rbk error dskipped ; do
[ ${name} == "tx_name" ] && continue
[ ${name} == "tpmC" ] && continue
[ ${name} == "tpmTotal" ] && continue
echo " <tr>"
echo " <td align=\"left\">${name}</td>"
echo " <td align=\"right\">${ninth}</td>"
echo " <td align=\"right\">${max}</td>"
echo " <td align=\"right\">${count}</td>"
echo " <td align=\"right\">${percent}</td>"
echo " <td align=\"right\">${rbk}</td>"
echo " <td align=\"right\">${error}</td>"
echo " <td align=\"right\">${dskipped}</td>"
echo " </tr>"
done >>report.html
tpmC=$(grep "^tpmC," data/tx_summary.csv | sed -e 's/[^,]*,//' -e 's/,.*//')
tpmCpct=$(grep "^tpmC," data/tx_summary.csv | sed -e 's/[^,]*,[^,]*,//' -e 's/,.*//')
tpmTotal=$(grep "^tpmTotal," data/tx_summary.csv | sed -e 's/[^,]*,//' -e 's/,.*//')
cat >>report.html <<_EOF_
</table>
</p>
<p>
<table border="0">
<tr>
<td align="left"><big><b>Overall tpmC:</b></big></td>
<td align="right"><big><b>${tpmC}</b></big></td>
</tr>
<tr>
<td align="left"><big><b>Overall tpmTotal:</b></big></td>
<td align="right"><big><b>${tpmTotal}</b></big></td>
</tr>
</table>
</p>
<p>
The TPC-C specification has an theoretical maximum of 12.86 NEW_ORDER
transactions per minute per warehouse. In reality this value cannot
be reached because it would require a perfect mix with 45% of NEW_ORDER
transactions and a ZERO response time from the System under Test
including the database.
</p>
<p>
The above tpmC of ${tpmC} is ${tpmCpct} of that theoretical maximum for a
database with $(getRunInfo runWarehouses) warehouses.
</p>
_EOF_
# ----
# Show the graphs for tpmC/tpmTOTAL and latency.
# ----
cat >>report.html <<_EOF_
<h2>
Transactions per Minute and Transaction Latency
</h2>
<p>
tpmC is the number of NEW_ORDER Transactions, that where processed
per minute. tpmTOTAL is the number of Transactions processed per
minute for all transaction types, but without the background part
of the DELIVERY transaction.
<br/>
<img src="tpm_nopm.png"/>
<br/>
<img src="latency.png"/>
</p>
_EOF_
# ----
# Add all the System Resource graphs. First the CPU and dirty buffers.
# ----
cat >>report.html <<_EOF_
<h2>
System Resource Usage
</h2>
<h3>
CPU Utilization
</h3>
<p>
The percentages for User, System and IOWait CPU time are stacked
on top of each other.
<br/>
<img src="cpu_utilization.png"/>
</p>
<h3>
Dirty Kernel Buffers
</h3>
<p>
We track the number of dirty kernel buffers, as measured by
the "nr_dirty" line in /proc/vmstat, to be able to correlate
IO problems with when the kernel's IO schedulers are flushing
writes to disk. A write(2) system call does not immediately
cause real IO on a storage device. The data written is just
copied into a kernel buffer. Several tuning parameters control
when the OS is actually transferring these dirty buffers to
the IO controller(s) in order to eventually get written to
real disks (or similar).
<br/>
<img src="dirty_buffers.png"/>
</p>
_EOF_
# ----
# Add all the block device IOPS and KBPS
# ---
for devdata in data/blk_*.csv ; do
if [ ! -f "$devdata" ] ; then
break
fi
dev=$(basename ${devdata} .csv)
cat >>report.html <<_EOF_
<h3>
Block Device ${dev}
</h3>
<p>
<img src="${dev}_iops.png"/>
<br/>
<img src="${dev}_kbps.png"/>
</p>
_EOF_
done
# ----
# Add all the network device IOPS and KBPS
# ---
for devdata in data/net_*.csv ; do
if [ ! -f "$devdata" ] ; then
break
fi
dev=$(basename ${devdata} .csv)
cat >>report.html <<_EOF_
<h3>
Network Device ${dev}
</h3>
<p>
<img src="${dev}_iops.png"/>
<br/>
<img src="${dev}_kbps.png"/>
</p>
_EOF_
done
# ----
# Finish the document.
# ----
cat >>report.html <<_EOF_
</body>
</html>
_EOF_
echo "OK"