fix bug for node metrics on overview page

Signed-off-by: zhu733756 <talonzhu@yunify.com>
This commit is contained in:
zhu733756
2021-04-12 13:49:38 +08:00
parent 26e5c31d8f
commit f49a9c1620
4 changed files with 17 additions and 3 deletions

View File

@@ -90,6 +90,7 @@ type reqParams struct {
cluster string
services string
pvcFilter string
queryType string
}
type queryOptions struct {
@@ -145,6 +146,7 @@ func parseRequestParams(req *restful.Request) reqParams {
r.componentType = req.PathParameter("component")
r.expression = req.QueryParameter("expr")
r.metric = req.QueryParameter("metric")
r.queryType = req.QueryParameter("type")
return r
}
@@ -213,6 +215,7 @@ func (h handler) makeQueryOptions(r reqParams, lvl monitoring.Level) (q queryOpt
NodeName: r.nodeName,
PVCFilter: r.pvcFilter, // metering pvc
StorageClassName: r.storageClassName, // metering pvc
QueryType: r.queryType,
}
q.namedMetrics = model.NodeMetrics