diff --git a/app/node_modules/xo-services/index.js b/app/node_modules/xo-services/index.js index 5e8c2afa4..ce6b37f15 100644 --- a/app/node_modules/xo-services/index.js +++ b/app/node_modules/xo-services/index.js @@ -79,7 +79,9 @@ export default angular.module('xoWebApp.services', [ } if (stat[0] instanceof Array) { // init arrays - metrics[statKey + '_average'] = [] + if (statKey === 'cpus') { + metrics['All CPUs'] = [] + } for (statCounter = 0; statCounter < stat.length; statCounter++) { metricName = computeMetricFullname(statKey, statCounter) if (statKey !== 'cpus') { // hosts can have 32+ cpu, don't want the detail @@ -101,11 +103,14 @@ export default angular.module('xoWebApp.services', [ }) } } - metrics[statKey + '_average'].push({ - date: d, - value: sum / stat.length, - textValue: computeTextValue(object, statKey, sum / stat.length) - }) + + if (statKey === 'cpus') { + metrics['All CPUs'].push({ + date: d, + value: sum / stat.length, + textValue: computeTextValue(object, statKey, sum / stat.length) + }) + } } } else { metricName = computeMetricFullname(statKey, '') @@ -127,7 +132,7 @@ export default angular.module('xoWebApp.services', [ agglomeratedStats.details[object.id] = metrics }) // agglomerate objects stats - agglomeratedStats.keys = statKeys + agglomeratedStats.keys = statKeys.sort() /* foreach(statKeys, function (statKey) { let dateCounter, sum, d