Skip to content

Commit

Permalink
narcissus: autoscale y for each graph, machines with max 2 builds/day…
Browse files Browse the repository at this point in the history
… look weird, but such is life

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
  • Loading branch information
koenkooi committed May 11, 2011
1 parent f7248be commit f11751b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions graph.php
Expand Up @@ -23,7 +23,6 @@

$firstdate = time() + 500;
$lastdate = 0;
$maxbuilds = 0;

$handle = fopen ("./deploy/stats.txt", "a+");
while ($stats = fscanf($handle, "%s %s\n")) {
Expand Down Expand Up @@ -74,7 +73,7 @@
if (isset($builds[$machine][$statsdate])) {
$buildcount = $builds[$machine][$statsdate];
$yvars[$machine] .= "[ $i, $buildcount ], \n";
if($maxbuilds < $builds[$machine][$statsdate]) $maxbuilds = $builds[$machine][$statsdate];
if($maxbuilds[$machine] < $builds[$machine][$statsdate]) $maxbuilds[$machine] = $builds[$machine][$statsdate];
$didbuild[$machine] = 1;
} else {
$yvars[$machine] .= "[ $i, 0 ], \n";
Expand All @@ -88,8 +87,7 @@
"colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[0]),
"padding": {left: 0, right: 0, top: 10, bottom: 30},
"xTicks": [<? print $xticks; ?> ],
"drawYAxis": false,
"yAxis": [0, <?print $maxbuilds; ?>],
"drawYAxis": true,
"yTickPrecision": 0
};

Expand Down

0 comments on commit f11751b

Please sign in to comment.