/[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 950 by rda, Tue Apr 19 12:09:23 2011 UTC revision 951 by rda, Tue Apr 19 13:13:33 2011 UTC
# Line 133  $r = preg_match_all($re, Line 133  $r = preg_match_all($re,
133  $pkgs = array();  $pkgs = array();
134    
135  $buildtime_total = array();  $buildtime_total = array();
136    $buid_dates = array();
137    
138  foreach ($matches as $val) {  foreach ($matches as $val) {
139    
# Line 171  foreach ($matches as $val) { Line 172  foreach ($matches as $val) {
172          // parse build bot from $data          // parse build bot from $data
173          $pkgs[$key]['status']['build'] = 1;          $pkgs[$key]['status']['build'] = 1;
174      } else if ($ext == '.done') {      } else if ($ext == '.done') {
175            // beware! this block is called twice for a given $key
176    
177          $pkgs[$key]['buildtime']['start'] = key2timestamp($val[6]);          $pkgs[$key]['buildtime']['start'] = key2timestamp($val[6]);
178          $pkgs[$key]['buildtime']['end'] = round($val[12]);          $pkgs[$key]['buildtime']['end'] = round($val[12]);
179          $pkgs[$key]['buildtime']['diff'] = $pkgs[$key]['buildtime']['end'] - $pkgs[$key]['buildtime']['start'];          $pkgs[$key]['buildtime']['diff'] = $pkgs[$key]['buildtime']['end'] - $pkgs[$key]['buildtime']['start'];
180                    
181            @$build_dates[date('H', $pkgs[$key]['buildtime']['start'])] += 1;
182            
183          // keep obviously dubious values out of there          // keep obviously dubious values out of there
184          // 12 hours is be an acceptable threshold given current BS global perfs          // 12 hours is be an acceptable threshold given current BS global perfs
185          // as of April 2011          // as of April 2011
# Line 185  foreach ($matches as $val) { Line 190  foreach ($matches as $val) {
190  }  }
191  // sort by key in reverse order to have more recent pkgs first  // sort by key in reverse order to have more recent pkgs first
192  krsort($pkgs);  krsort($pkgs);
193    ksort($build_dates);
194    
195  $build_count = count($buildtime_total);  $build_count = count($buildtime_total);
196  $buildtime_total = array_sum($buildtime_total);  $buildtime_total = array_sum($buildtime_total);
# Line 412  if ($total > 0) { Line 418  if ($total > 0) {
418      $s .= $bts;      $s .= $bts;
419      $s .= '</table><span style="font-size: 85%;">Does not take<br />build failures<br />into account.</span>';      $s .= '</table><span style="font-size: 85%;">Does not take<br />build failures<br />into account.</span>';
420    
421        $s .= '<table style="width:100%;"><caption>Build times</caption>';
422        $max = max($build_dates2);
423        foreach ($build_dates2 as $time => $count)
424            $s .= sprintf('<tr><td>%d</td><td><span style="width: %dpx; height: 10px; background: #aaa;" title="%d"></span></td></tr>',
425                $time, round($count / $max * 100), $count);
426        $s .= '</table>';
427    
428      $s .= '</div>';      $s .= '</div>';
429    
430      echo $s;      echo $s;

Legend:
Removed from v.950  
changed lines
  Added in v.951

  ViewVC Help
Powered by ViewVC 1.1.30