forked from antonblanchard/will-it-scale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostprocess
executable file
·94 lines (83 loc) · 1.85 KB
/
postprocess
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
#!/bin/sh
cat << EOF
<html>
<head>
<title>Will it scale?</title>
<script type="text/javascript" src="dygraph-combined.js"></script>
<style type="text/css" media="screen">
#header {
position: fixed;
width: auto;
top: 0;
right: 0;
left: auto;
bottom: auto;
background: #eee;
border: 1px solid #ccc;
}
</style>
</head>
<body>
<div id="header">
<p><b>Display:</b>
<input type=checkbox id=0 onClick="change_visibility(this)" checked>
<label for="0"> Processes</label>
<input type=checkbox id=1 onClick="change_visibility(this)" checked>
<label for="1"> Processes idle</label>
<input type=checkbox id=2 onClick="change_visibility(this)" checked>
<label for="2"> Threads</label>
<input type=checkbox id=3 onClick="change_visibility(this)" checked>
<label for="3"> Threads idle</label>
<input type=checkbox id=4 onClick="change_visibility(this)" checked>
<label for="4"> Linear scaling</label>
</p>
</div>
<script type="text/javascript">
var maxgraph = 0;
var graphs = [];
function change_visibility(el) {
for (i = 0; i < maxgraph; i++) {
graphs[i].setVisibility(el.id, el.checked);
}
}
</script>
EOF
for i in `ls *.csv`
do
BASENAME=`basename $i .csv`
TITLE=`cat $BASENAME.title`
echo "<h2>$TITLE</h2>"
cat <<EOF
<table><tr>
<td valign="top"><div id="$BASENAME"
style="width:500px; height:300px;"></div></td>
<td valign="top"> </td>
<td valign="top"><div id="${BASENAME}_labels" style="width:300px;"></div></td>
</tr></table>
<p>
<script type="text/javascript">
graphs[maxgraph++] = new Dygraph(
document.getElementById("$BASENAME"),
"$i",
{
labelsDiv: document.getElementById("${BASENAME}_labels"),
labelsSeparateLines: true,
labelsKMB: true,
colors: ['green', 'green', 'red', 'red', 'blue'],
'processes_idle': {
axis: {
valueRange: [0, 100.1]
}
},
'threads_idle': {
axis: 'processes_idle'
}
}
);
</script>
EOF
done
cat << EOF
</body>
</html>
EOF