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 |
|
|
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 |
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); |
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; |