/[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 929 by rda, Mon Apr 18 18:59:16 2011 UTC revision 930 by rda, Mon Apr 18 20:49:39 2011 UTC
# Line 361  if ($total > 0) { Line 361  if ($total > 0) {
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

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

  ViewVC Help
Powered by ViewVC 1.1.30