change workload metrics, add node-pod-container metrics api

This commit is contained in:
Carman Zhang
2018-11-27 11:35:23 +08:00
parent 9a6880bc9c
commit cb1c03961b
5 changed files with 143 additions and 104 deletions

View File

@@ -113,9 +113,13 @@ func Sort(sortMetricName string, sortType string, fmtLevelMetric *FormatedLevelM
// for some reasons, 'metric' may not contain `resourceType` field
// example: {"metric":{},"value":[1541142931.731,"3"]}
k, exist := r[ResultItemMetric].(map[string]interface{})[resourceType]
key := k.(string)
if exist {
indexMap[k.(string)] = i
i = i + 1
if _, exist := indexMap[key]; !exist {
indexMap[key] = i
i = i + 1
}
}
}
}