361 |
$s .= '</table><br /><br />'; |
$s .= '</table><br /><br />'; |
362 |
|
|
363 |
$s .= '<table><caption>Build time</caption></tr><th></th><th></th></tr>'; |
$s .= '<table><caption>Build time</caption></tr><th></th><th></th></tr>'; |
364 |
ksort($buildtime_stats); |
|
365 |
|
/** |
366 |
|
*/ |
367 |
|
function timesort($a, $b) |
368 |
|
{ |
369 |
|
$a = explode(' ', trim($a)); |
370 |
|
$b = explode(' ', trim($b)); |
371 |
|
|
372 |
|
if ($a[1] == 'hour' || $a[1] == 'hours') |
373 |
|
$a[0] *= 3600; |
374 |
|
|
375 |
|
if ($b[1] == 'hour' || $a[1] == 'hours') |
376 |
|
$b[0] *= 3600; |
377 |
|
|
378 |
|
if ($a[0] > $b[0]) |
379 |
|
return 1; |
380 |
|
elseif ($a[0] < $b[0]) |
381 |
|
return -1; |
382 |
|
|
383 |
|
return 0; |
384 |
|
} |
385 |
|
uksort($buildtime_stats, "timesort"); |
386 |
|
|
387 |
foreach ($buildtime_stats as $time => $count) { |
foreach ($buildtime_stats as $time => $count) { |
388 |
$s .= sprintf('<tr><td><td>%s</td><td>%d</td></tr>', |
$s .= sprintf('<tr><td>%s</td><td>%d</td></tr>', |
389 |
$time, $count); |
$time, $count); |
390 |
} |
} |
391 |
// TODO (rda) compute/show average for all builds |
// TODO (rda) compute/show average for all builds |