[Branch,~linaro-validation/lava-scheduler/trunk] Rev 201: improve job reports visual

Message ID 20120720203109.28394.91789.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Andy Doan July 20, 2012, 8:31 p.m.
------------------------------------------------------------
revno: 201
committer: Andy Doan <andy.doan@linaro.org>
branch nick: lava-scheduler
timestamp: Fri 2012-07-20 15:29:27 -0500
message:
  improve job reports visual
  
  this normalizes the reports to be a percentage that way progress is
  more obvious. it also changes to a line graph
modified:
  lava_scheduler_app/templates/lava_scheduler_app/reports.html


--
lp:lava-scheduler
https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk

You are subscribed to branch lp:lava-scheduler.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription

Patch

=== modified file 'lava_scheduler_app/templates/lava_scheduler_app/reports.html'
--- lava_scheduler_app/templates/lava_scheduler_app/reports.html	2012-07-17 22:20:10 +0000
+++ lava_scheduler_app/templates/lava_scheduler_app/reports.html	2012-07-20 20:29:27 +0000
@@ -10,27 +10,26 @@ 
 <script type="text/javascript">
 $(document).ready(function() {
 var dpass = [];
-var dfail = [];
 var ddates= [];
 {% for day in health_day_report %}
-  dpass.push([{{forloop.counter0}}, {{day.pass}}]);
-  dfail.push([{{forloop.counter0}}, {{day.fail}}]);
+  dpass.push([{{forloop.counter0}}, 100*{{day.pass}}/({{day.pass}}+{{day.fail}})]);
   ddates.push([{{forloop.counter0}}, "{{day.date}}<br/>Pass: {{day.pass}}<br/>Fail: {{day.fail}}"]);
 {% endfor %}
 
   var ddata = [
-    {'label': 'Fail', 'data': dfail, 'color': '#FF0000'},
-    {'label': 'Pass', 'data': dpass, 'color': '#00FF00'},
+    {'label': '% Pass', 'data': dpass, 'color': '#00FF00'},
   ];
 
   $.plot($("#placeholder-daily"), ddata, {
     series: {
-      stack: true,
-      bars: { show: true, barWidth: 0.6 },
+      lines: { show: true, fill: true, steps: false },
     },
     xaxis: {
       ticks: ddates,
     },
+    yaxis: {
+      max: 100,
+    },
   });
 }
 );
@@ -44,28 +43,26 @@ 
 <script type="text/javascript">
 $(document).ready(function() {
 var wpass = [];
-var wfail = [];
 var wdates= [];
 {% for week in health_week_report %}
-  wpass.push([{{forloop.counter0}}, {{week.pass}}]);
-  wfail.push([{{forloop.counter0}}, {{week.fail}}]);
+  wpass.push([{{forloop.counter0}}, 100*{{week.pass}}/({{week.pass}}+{{week.fail}})]);
   wdates.push([{{forloop.counter0}}, "{{week.date}}<br/>Pass: {{week.pass}}<br/>Fail: {{week.fail}}"]);
 {% endfor %}
 
   var wdata = [
-    {'label': 'Fail', 'data': wfail, 'color': '#FF0000'},
-    {'label': 'Pass', 'data': wpass, 'color': '#00FF00'},
+    {'label': '% Pass', 'data': wpass, 'color': '#00FF00'},
   ];
 
   $.plot($("#placeholder-weekly"), wdata, {
     series: {
-      stack: true,
-      //lines: { show: true, fill: true, steps: false },
-      bars: { show: true, barWidth: 0.6 },
+      lines: { show: true, fill: true, steps: false },
     },
     xaxis: {
       ticks: wdates,
     },
+    yaxis: {
+      max: 100,
+    },
   });
 }
 );
@@ -80,27 +77,26 @@ 
 <script type="text/javascript">
 $(document).ready(function() {
 var jdpass = [];
-var jdfail = [];
 var jddates= [];
 {% for day in job_day_report %}
-  jdpass.push([{{forloop.counter0}}, {{day.pass}}]);
-  jdfail.push([{{forloop.counter0}}, {{day.fail}}]);
+  jdpass.push([{{forloop.counter0}}, 100*{{day.pass}}/({{day.pass}}+{{day.fail}})]);
   jddates.push([{{forloop.counter0}}, "{{day.date}}<br/>Pass: {{day.pass}}<br/>Fail: {{day.fail}}"]);
 {% endfor %}
 
   var jddata = [
-    {'label': 'Fail', 'data': jdfail, 'color': '#FF0000'},
-    {'label': 'Pass', 'data': jdpass, 'color': '#00FF00'},
+    {'label': '% Pass', 'data': jdpass, 'color': '#00FF00'},
   ];
 
   $.plot($("#placeholder-job-daily"), jddata, {
     series: {
-      stack: true,
-      bars: { show: true, barWidth: 0.6 },
+      lines: { show: true, fill: true, steps: false },
     },
     xaxis: {
       ticks: jddates,
     },
+    yaxis: {
+      max: 100,
+    },
   });
 }
 );
@@ -114,28 +110,26 @@ 
 <script type="text/javascript">
 $(document).ready(function() {
 var jwpass = [];
-var jwfail = [];
 var jwdates= [];
 {% for week in job_week_report %}
-  jwpass.push([{{forloop.counter0}}, {{week.pass}}]);
-  jwfail.push([{{forloop.counter0}}, {{week.fail}}]);
+  jwpass.push([{{forloop.counter0}}, 100*{{week.pass}}/({{week.pass}}+{{week.fail}})]);
   jwdates.push([{{forloop.counter0}}, "{{week.date}}<br/>Pass: {{week.pass}}<br/>Fail: {{week.fail}}"]);
 {% endfor %}
 
   var jwdata = [
-    {'label': 'Fail', 'data': jwfail, 'color': '#FF0000'},
-    {'label': 'Pass', 'data': jwpass, 'color': '#00FF00'},
+    {'label': '% Pass', 'data': jwpass, 'color': '#00FF00'},
   ];
 
   $.plot($("#placeholder-job-weekly"), jwdata, {
     series: {
-      stack: true,
-      //lines: { show: true, fill: true, steps: false },
-      bars: { show: true, barWidth: 0.6 },
+      lines: { show: true, fill: true, steps: false },
     },
     xaxis: {
       ticks: jwdates,
     },
+    yaxis: {
+      max: 100,
+    },
   });
 }
 );