summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas De Schampheleire <thomas.de.schampheleire@gmail.com>2013-08-28 08:56:59 (GMT)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-08-28 08:56:59 (GMT)
commite709e851011498b94fb007d44509f255be46309d (patch)
tree093ef87681984b0f4884bc0b84f795b167a4c3ca
parentc3e7b0ff4b3d7fc4a230776236c96a44ddec9a71 (diff)
downloadbuildroot-test-e709e851011498b94fb007d44509f255be46309d.tar.gz
buildroot-test-e709e851011498b94fb007d44509f255be46309d.tar.bz2
graph: show percentage instead of absolute values
Showing absolute values in the graph isn't very helpful, as the total number of builds per day varies. Showing the percentage of failed/successful builds on each day is a lot more useful to capture the trend of build successes. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--web/graph.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/web/graph.php b/web/graph.php
index c37bc88..d69a4c0 100644
--- a/web/graph.php
+++ b/web/graph.php
@@ -26,18 +26,16 @@ $total_data = array();
while($current = mysql_fetch_object($ret)) {
array_push($dates_data, $current->day);
- array_push($success_data, $current->success);
- array_push($failures_data, $current->failures);
- array_push($timeouts_data, $current->timeouts);
- array_push($total_data, $current->total);
+ array_push($success_data, $current->success * 100 / $current->total);
+ array_push($failures_data, $current->failures * 100 / $current->total);
+ array_push($timeouts_data, $current->timeouts * 100 / $current->total);
}
/* Add data in your dataset */
-$myData->addPoints($success_data, "success");
-$myData->addPoints($failures_data, "failure");
-$myData->addPoints($timeouts_data, "timeout");
-$myData->addPoints($total_data, "total");
-$myData->setAxisName(0,"Number of builds");
+$myData->addPoints($success_data, "success %");
+$myData->addPoints($failures_data, "failure %");
+$myData->addPoints($timeouts_data, "timeout %");
+$myData->setAxisName(0,"Percentage of builds");
$myData->addPoints($dates_data, "Labels");
$myData->setSerieDescription("Labels","Dates");