87 |
* @return string |
* @return string |
88 |
*/ |
*/ |
89 |
if (is_null($end)) { |
if (is_null($end)) { |
90 |
$end = time(); |
$end = time(); |
91 |
} |
} |
92 |
$diff = $end - $start; |
$diff = $end - $start; |
93 |
if ($diff<60) |
if ($diff<60) |
282 |
|
|
283 |
######################################### |
######################################### |
284 |
|
|
285 |
|
$buildtime_stats = array(); |
286 |
|
|
287 |
$s = ''; |
$s = ''; |
288 |
$tmpl = <<<T |
$tmpl = <<<T |
289 |
<tr class="%s"> |
<tr class="%s"> |
320 |
$p['type']; |
$p['type']; |
321 |
|
|
322 |
$s .= '</td><td>'; |
$s .= '</td><td>'; |
323 |
if ($p['type'] == 'uploaded') |
if ($p['type'] == 'uploaded') { |
324 |
$s .= timediff($p['buildtime']['start'], $p['buildtime']['end']); |
$tdiff = timediff($p['buildtime']['start'], $p['buildtime']['end']); |
325 |
|
$s .= $tdiff; |
326 |
|
@$buildtime_stats[$tdiff] += 1; |
327 |
|
} |
328 |
$s .= '</td>'; |
$s .= '</td>'; |
329 |
//$s .= '<td>' . sprintf($badges[$p['type']], $p['user']) . '</td>'; |
//$s .= '<td>' . sprintf($badges[$p['type']], $p['user']) . '</td>'; |
330 |
$s .= '</tr>'; |
$s .= '</tr>'; |
358 |
$s .= sprintf('<tr><td><a href="/?user=%s">%s</a></td><td>%d</td></tr>', |
$s .= sprintf('<tr><td><a href="/?user=%s">%s</a></td><td>%d</td></tr>', |
359 |
$k, $k, $v); |
$k, $k, $v); |
360 |
|
|
361 |
|
$s .= '</table><br /><br />'; |
362 |
|
|
363 |
|
$s .= '<table><caption>Build time</caption></tr><th></th><th></th></tr>'; |
364 |
|
ksort($buildtime_stats); |
365 |
|
foreach ($buildtime_stats as $time => $count) { |
366 |
|
$s .= sprintf('<tr><td><td>%s</td><td>%d</td></tr>', |
367 |
|
$time, $count); |
368 |
|
} |
369 |
|
// TODO (rda) compute/show average for all builds |
370 |
$s .= '</table>'; |
$s .= '</table>'; |
371 |
|
|
372 |
$s .= '</div>'; |
$s .= '</div>'; |
373 |
|
|
374 |
echo $s; |
echo $s; |