add resource type differentiation in node overview
@@ -343,7 +343,7 @@ export default {
}
}
obj['scales']['yAxes'][0]['scaleLabel']['labelString'] = unit
- if (metricName === 'mem_util' || metricName === 'gpu_util' || metricName === 'fan_speed') {
+ if (metricName === 'mem_util' || metricName === 'utilization' || metricName === 'fan_speed') {
obj['scales']['yAxes'][0]['ticks'] = {
suggestedMin: 0,
max: 100
@@ -371,8 +371,10 @@ export default {
apiRequest: function (node, nodeName, counter) {
var metric, resourceType, value
var data = []
+ for (var resourceTypeName in node) {
+ resourceType = node[resourceTypeName]
api
- .request('get', '/nodes/' + nodeName + '/gpu/metrics', this.$store.state.accessToken)
+ .request('get', '/nodes/' + nodeName + '/' + resourceTypeName.toLowerCase() + '/metrics', this.$store.state.accessToken)
.then(response => {
data = response.data
for (var resourceTypeName in node) {
@@ -380,6 +382,7 @@ export default {
for (var metricName in resourceType.metrics) {
metric = resourceType.metrics[metricName]
for (var i = 0; i < metric.data.datasets.length; i++) {
+ if (_.has(data, metric.data.datasets[i].uuid)) {
value = isNaN(data[metric.data.datasets[i].uuid][metric.metricName])
? data[metric.data.datasets[i].uuid][metric.metricName].value
: data[metric.data.datasets[i].uuid][metric.metricName]
@@ -388,6 +391,7 @@ export default {
}
}
}
+ }
if (!counter) {
this.updateChart = !this.updateChart
}
@@ -395,6 +399,7 @@ export default {
.catch(error => {
this.handleError(error)
})
+ }
},
addWatch: function () {
