/[soft]/build_system/web/index.php
ViewVC logotype

Diff of /build_system/web/index.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 645 by dmorgan, Fri Mar 11 16:32:38 2011 UTC revision 929 by rda, Mon Apr 18 18:59:16 2011 UTC
# Line 87  function timediff($start, $end) { Line 87  function timediff($start, $end) {
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)
# Line 282  echo sprintf( Line 282  echo sprintf(
282    
283  #########################################  #########################################
284    
285    $buildtime_stats = array();
286    
287  $s = '';  $s = '';
288  $tmpl = <<<T  $tmpl = <<<T
289  <tr class="%s">  <tr class="%s">
# Line 318  if ($total > 0) { Line 320  if ($total > 0) {
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>';
# Line 353  if ($total > 0) { Line 358  if ($total > 0) {
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;

Legend:
Removed from v.645  
changed lines
  Added in v.929

  ViewVC Help
Powered by ViewVC 1.1.30