1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Bug #3133: Fix flot series so they stack properly

When any data point was missing, the series were not stacked
properly. Now all points are initialized to 0.
This commit is contained in:
Carlos Martín 2014-10-22 16:24:09 +02:00
parent f1cd7c1eeb
commit 8f90884c1d

View File

@ -5213,6 +5213,14 @@ function fillAccounting(div, req, response, no_table) {
var t = times[i];
var t_next = times[i+1];
// To stack values properly, flot needs an entry for all
// the time slots
if(serie[t] == undefined){
serie[t] = {};
serie[t].CPU_HOURS = 0;
serie[t].MEM_HOURS = 0;
}
if( (history.ETIME*1000 > t || history.ETIME == 0) &&
(history.STIME != 0 && history.STIME*1000 <= t_next) ) {
@ -5228,12 +5236,6 @@ function fillAccounting(div, req, response, no_table) {
var n_hours = (etime - stime) / 1000 / 60 / 60;
if(serie[t] == undefined){
serie[t] = {};
serie[t].CPU_HOURS = 0;
serie[t].MEM_HOURS = 0;
}
// --- cpu ---
var val = parseFloat(history.VM.TEMPLATE.CPU) * n_hours;