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
|
#!/usr/bin/perl
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
#
# Compare filebench results
#
# Usage: filebench_summary <dir1> <dir2> ...
#
use CGI ':standard';
$maxiopsoverall = 0;
$maxiopsrate = 0;
$maxbandwidth = 0;
#
# Create html and text
#
open (HTML, ">index.html");
print HTML start_html(-title=>'Filebench');
print HTML "<body>";
#
# Print aggregate flowop stats
#
foreach $dir (@ARGV) {
printf ("Generating html for $dir\n");
open (PROFILE, "<$dir/thisrun.prof");
$description = <PROFILE>;
$description =~ s/.*"(.+)".*/$1/;
$files = `ls $dir/stats.*.out $dir/*/stats.*.out 2>/dev/null`;
foreach $file (split(/\n/, $files)) {
print "file = $file\n";
# Search backwards in-case the hostname is of FQDN or there's a
# '.' in $dir.
$rstr = reverse $file;
($rfstype, $rworkload, $rprefix) = split(/\./, $rstr);
$prefix = reverse $rprefix;
$workload = reverse $rworkload;
$fstype = reverse $rfstype;
$dataset = $dir;
$dataset =~ s/.*\/(.+)$/$1/;
$dataset =~ s/\/$//;
$desc{$dataset} = "$description";
open (STATS, $file);
$tmp = <STATS>;
while (<STATS>) {
($flowop, $ops, $bandwidth, $latency, $cpu, $wait, $seconds) = split(/[ \t]+/, $_);
if (/^$/) {
$tmp = <STATS>;
($fluff, $opcnt, $ops, $reads, $writes, $bandwidth,
$cpu) = split(/[ \tA-z:\/,]+/, $tmp);
$ops{$workload, $dataset} = $ops;
last;
}
$ops =~ s/ops\/s//;
$bandwidth =~ s/mb\/s//;
$latency =~ s/ms\/op//;
$cpu =~ s/us\/op//;
# Collapse shadow reads into single metric
if ($flowop =~ /shadowread/) {
$flowop = "shadow-read";
}
# Collapse database writes into single metric
if ($flowop =~ /db.*write/) {
$flowop = "db-write";
}
# Collapse database writes into single metric
if ($flowop =~ /db.*write/) {
$flowop = "db-write";
}
$datasets{$dataset} = $dataset;
$workloads{$workload} = $workload;
$flowops{$flowop} = $flowop;
$wkl_flowops{$flowop, $workload} = $flowop;
$wkl_workload{$flowop, $workload} = $workload;
$flow_ops{$flowop, $workload, $dataset} += $ops;
$flow_bandwidth{$flowop, $workload, $dataset} += $bandwidth;
$flow_latency{$flowop, $workload, $dataset} += $latency;
$flow_cpu{$flowop, $workload, $dataset} += $cpu;
$bandwidth{$workload, $dataset} += $bandwidth;
$latency{$workload, $dataset} += $latency;
$cpu{$workload, $dataset} += $cpu;
$flowopcnt{$flowop, $workload, $dataset}++;
$workloadcnt{$workload, $dataset}++;
}
close(STATS);
}
}
# HTML IOPS
print HTML h1('Throughput breakdown (ops per second)');
print HTML "<table border=1>";
print HTML "<b><td>Workload</td>";
foreach $dataset (sort {$a cmp $b}(keys %datasets)) {
print HTML "<td>$desc{$dataset}</td>";
}
print HTML "</b></tr>";
foreach $workload (sort (keys %workloads)) {
print HTML "<b><tr><td>$workload</td>";
$last = 0;
foreach $dataset (sort {$a cmp $b}(keys %datasets)) {
$color = "white";
$this = $ops{$workload, $dataset};
if ($last && ($this - $last) < ($last * -0.1)) {
$color = "red";
}
if ($last && ($this - $last) > ($last * 0.1)) {
$color = "green";
}
printf HTML ("<td>%d</td\n", $this);
$last = $ops{$workload, $dataset};
}
print HTML "</b></tr>";
}
print HTML "</table>";
# HTML Bandwidth
print HTML h1('Bandwidth breakdown (MB/s)');
print HTML "<table border=1>";
print HTML "<td>Workload</td>";
foreach $dataset (sort {$a cmp $b}(keys %datasets)) {
print HTML "<td>$desc{$dataset}</td>";
}
print HTML "</tr>";
foreach $workload (sort (keys %workloads)) {
$bandwidth = 0;
foreach $dataset (sort {$a cmp $b}(keys %datasets)) {
$bandwidth += $bandwidth{$workload, $dataset};
}
next if ($bandwidth == 0);
print HTML "<tr><td>$workload</td>";
foreach $dataset (sort {$a cmp $b}(keys %datasets)) {
printf HTML ("<td>%d</td>\n", $bandwidth{$workload, $dataset});
}
print HTML "</tr>";
}
print HTML "</table>";
# HTML Latency
print HTML h1('Latency breakdown (ms per op)');
print HTML "<table border=1>";
print HTML "<td>Workload</td>";
foreach $dataset (sort {$a cmp $b}(keys %datasets)) {
print HTML "<td>$desc{$dataset}</td>";
}
print HTML "</tr>";
foreach $workload (sort (keys %workloads)) {
print HTML "<tr><td>$workload</td>";
foreach $dataset (sort {$a cmp $b}(keys %datasets)) {
if ( $workloadcnt{$workload, $dataset}) {
printf HTML ("<td>%.1f</td>", $latency{$workload,
$dataset} / $workloadcnt{$workload, $dataset});
} else {
printf HTML ("<td></td>");
}
}
print HTML "</tr>";
foreach $flowop (keys %wkl_flowops) {
next if ("$wkl_workload{$flowop}" ne "$workload");
print HTML "<tr><td><i>__$wkl_flowops{$flowop}</td>";
foreach $dataset (sort {$a cmp $b}(keys %datasets)) {
if ( $flowopcnt{$flowop, $dataset}) {
printf HTML ("<td>%.1f</td>\n", $flow_latency{$flowop,
$dataset} / $flowopcnt{$flowop, $dataset});
} else {
printf HTML ("<td></td>");
}
}
print HTML "</i></tr>";
}
}
print HTML "</table>";
# HTML Efficiency
print HTML h1('Efficiency breakdown (Code path length in uS/op)');
print HTML "<table border=1>";
print HTML "<td>Workload</td>";
foreach $dataset (sort {$a cmp $b}(keys %datasets)) {
print HTML "<td>$desc{$dataset}</td>";
}
print HTML "</tr>";
foreach $workload (sort (keys %workloads)) {
print HTML "<tr><td>$workload</td>";
foreach $dataset (sort {$a cmp $b}(keys %datasets)) {
if ($workloadcnt{$workload, $dataset}) {
printf HTML ("<td>%d</td>", $cpu{$workload, $dataset}
/ $workloadcnt{$workload, $dataset});
} else {
printf HTML ("<td></td>");
}
}
print HTML "</tr>";
foreach $flowop (keys %wkl_flowops) {
next if ("$wkl_workload{$flowop}" ne "$workload");
print HTML "<tr><td><i>__$wkl_flowops{$flowop}</td>";
foreach $dataset (sort {$a cmp $b}(keys %datasets)) {
if ($flowopcnt{$flowop, $dataset}) {
printf HTML ("<td>%d</td>\n", $flow_cpu{$flowop,
$dataset} / $flowopcnt{$flowop, $dataset});
} else {
printf HTML ("<td></td>");
}
}
print HTML "</i></tr>";
}
}
print HTML "</table>";
end_html();
|