19 if (/^\*\*\* Timing layout processes on url: '(.*)'/) {
20 # This will generate a URL that looks something like:
22 # file:///foo/bar/website/index.html
24 # So, we'll parse out the ``website'' part...
25 my @parts = split('/', $1);
26 $::CurrentSite
= $parts[$#parts - 1];
28 if (! $::Sites
{$::CurrentSite
}) {
29 $::Sites
{$::CurrentSite
} = {};
34 next LINE
unless $::CurrentSite
;
36 CATEGORY
: foreach $category (@
::Categories
) {
37 next CATEGORY
unless (/$category/);
39 # The "real time" is indicated in HH:MM:SS.mmmm format
40 my ($h,$m,$s,$ms) = /Real time (..):(..):(..)\.(....)/;
43 $real += $m * 1000 * 60;
44 $real += $h * 1000 * 60 * 60;
46 # The "CPU time" is indicated in m.uuu format
47 my ($cpu) = /CP time (.*\....)/;
49 my $site = $::Sites
{$::CurrentSite
};
50 if (! $site->{$category}) {
51 $site->{$category} = { Count
=> 0, Real
=> 0, CPU
=> 0, Real2
=> 0, CPU2
=> 0 };
54 $site->{$category}->{Count
} += 1;
55 $site->{$category}->{Real
} += $real;
56 $site->{$category}->{CPU
} += $cpu;
57 $site->{$category}->{Real2
} += $real * $real;
58 $site->{$category}->{CPU2
} += $cpu * $cpu;
62 my $bgcolor0 = '#999999';
63 my $bgcolor1 = '#777777';
67 print "<table border='0' cellpadding='2' cellspacing='0'>\n";
70 print " <td rowspan='2' valign='bottom'>Site</td>\n";
73 foreach $category (@
::Categories
) {
74 print " <td bgcolor='$bgcolor' align='center' colspan='4'>$category</td>\n";
75 $bgcolor = ($bgcolor eq $bgcolor0) ?
$bgcolor1 : $bgcolor0;
82 foreach $category (@
::Categories
) {
83 print " <td bgcolor='$bgcolor' align='center' colspan='2'>CPU</td> <td bgcolor='$bgcolor' align='center' colspan='2'>Real</td>\n";
84 $bgcolor = ($bgcolor eq $bgcolor0) ?
$bgcolor1 : $bgcolor0;
88 foreach $sitename (sort(keys(%::Sites
))) {
91 my $site = $::Sites
{$sitename};
92 print " <td>$sitename</td>\n";
95 foreach $category (@
::Categories
) {
96 my $count = $site->{$category}->{Count
};
97 my $real = $site->{$category}->{Real
};
98 my $cpu = $site->{$category}->{CPU
};
99 my $real2 = $site->{$category}->{Real2
};
100 my $cpu2 = $site->{$category}->{CPU2
};
107 $realdev = sqrt( ( $real2 * $count - $real * $real ) / ( $count * ( $count - 1 ) ) );
108 $cpudev = sqrt( ( $cpu2 * $count - $cpu * $cpu ) / ( $count * ( $count - 1 ) ) );
120 printf " <td bgcolor='$bgcolor' align='right'>%0.2lf</td><td bgcolor='$bgcolor' align='left'>±%0.2lf</td>\n", $cpu, $cpudev;
121 printf " <td bgcolor='$bgcolor' align='right'>%0.2lf</td><td bgcolor='$bgcolor' align='left'>±%0.2lf</td>", $real, $realdev;
123 $bgcolor = ($bgcolor eq $bgcolor0) ?
$bgcolor1 : $bgcolor0;