Commit 7ee95995 authored by Jérome Perrin's avatar Jérome Perrin

Also output average daily attainment

parent d1181d2b
...@@ -496,20 +496,23 @@ ...@@ -496,20 +496,23 @@
var text = exit_stat.html() + "<br/><b>" + (el.name || el.id) + "</b><br/>"; var text = exit_stat.html() + "<br/><b>" + (el.name || el.id) + "</b><br/>";
$.each(el.results, function(metric, value){ $.each(el.results, function(metric, value){
if (metric == 'intervalThroughputList') { if (metric == 'intervalThroughputList') {
var general = that.getData().general, var attainment_list = [],
throughputTarget = parseFloat(general.throughputTarget), general = that.getData().general,
desiredPercentageOfSuccess = parseFloat(general.desiredPercentageOfSuccess); throughputTarget = parseFloat(general.throughputTarget),
text += "<em>Daily Attainment</em>: " desiredPercentageOfSuccess = parseFloat(general.desiredPercentageOfSuccess);
text += "<em>Daily Attainment:</em> "
$.each(value, function(i, intervalValue) { $.each(value, function(i, intervalValue) {
var icon = "fa-frown-o"; var icon = "fa-frown-o";
attainment_list.push((intervalValue/throughputTarget));
if ((intervalValue/throughputTarget) > desiredPercentageOfSuccess) { if ((intervalValue/throughputTarget) > desiredPercentageOfSuccess) {
icon = "fa-smile-o" icon = "fa-smile-o"
} }
text += intervalValue + '<i class="fa ' + icon + '"/> '; text += intervalValue + '<i class="fa ' + icon + '"/> ';
}) })
text += "<br/>"; text += "<br/><em>Average Daily Line Attainment</em>: " + (
(attainment_list.reduce(function(a, b){return a+b}) / attainment_list.length ) * 100).toFixed(2) + "%<br/>";
} else { } else {
text += "<em>" + metric + "</em>: " + value + "<br/>"; text += "<em>" + metric + ":</em> " + value + "<br/>";
} }
}) })
exit_stat.html(text); exit_stat.html(text);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment