Permalink
Browse files

narcissus: only display graphs of machines that had builds in the sel…

…ected timeframe

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
  • Loading branch information...
1 parent 7bbb2f2 commit f7248be11dccd925616a5b0d090070d84a4ea750 @koenkooi koenkooi committed May 11, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 graph.php
View
@@ -75,6 +75,7 @@
$buildcount = $builds[$machine][$statsdate];
$yvars[$machine] .= "[ $i, $buildcount ], \n";
if($maxbuilds < $builds[$machine][$statsdate]) $maxbuilds = $builds[$machine][$statsdate];
+ $didbuild[$machine] = 1;
} else {
$yvars[$machine] .= "[ $i, 0 ], \n";
}
@@ -109,7 +110,8 @@ function drawGraph() {
if(!isset($selectedmachine)) {
foreach($builds as $machine => $foo) {
$machineyvars = $yvars[$machine];
- print("
+ if($didbuild[$machine] == 1) {
+ print("
var layout = new PlotKit.Layout(\"bar\", options);
layout.addDataset(\"$machine usage count\", [$machineyvars]);
layout.evaluate();
@@ -120,6 +122,7 @@ function drawGraph() {
var plotter = new PlotKit.SweetCanvasRenderer(canvas, layout, {});
plotter.render();
");
+ }
}
} else {
$machine = $selectedmachine;
@@ -151,7 +154,7 @@ function drawGraph() {
if(!isset($selectedmachine)) {
foreach ($builds as $machine => $foo) {
- print("<div class='item'><table align=left><td><br>$machine<br><div id='div-$machine'><canvas id='graph-$machine'></canvas></div></td></table></div>\n");
+ if($didbuild[$machine] == 1) print("<div class='item'><table align=left><td><br>$machine<br><div id='div-$machine'><canvas id='graph-$machine'></canvas></div></td></table></div>\n");
}
} else {
print("<div class='item'><table align=left><td><br>$selectedmachine<br><div id='div-$machine'><canvas id='graph-$selectedmachine'></canvas></div></td></table></div>\n");

0 comments on commit f7248be

Please sign in to comment.