horizon: sort metrics name, rename cpu average to all cpus
This commit is contained in:
19
app/node_modules/xo-services/index.js
generated
vendored
19
app/node_modules/xo-services/index.js
generated
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user