mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-03 22:57:29 +01:00
add outofindex checks to external ccms codebase
This commit is contained in:
@@ -393,6 +393,10 @@ func (ccms *CCMetricStore) LoadStats(
|
|||||||
|
|
||||||
stats := make(map[string]map[string]schema.MetricStatistics, len(metrics))
|
stats := make(map[string]map[string]schema.MetricStatistics, len(metrics))
|
||||||
for i, res := range resBody.Results {
|
for i, res := range resBody.Results {
|
||||||
|
if len(res) == 0 {
|
||||||
|
// No Data Found For Metric, Logged in FetchData to Warn
|
||||||
|
continue
|
||||||
|
}
|
||||||
query := req.Queries[i]
|
query := req.Queries[i]
|
||||||
metric := query.Metric
|
metric := query.Metric
|
||||||
data := res[0]
|
data := res[0]
|
||||||
@@ -562,6 +566,11 @@ func (ccms *CCMetricStore) LoadNodeData(
|
|||||||
var errors []string
|
var errors []string
|
||||||
data := make(map[string]map[string][]*schema.JobMetric)
|
data := make(map[string]map[string][]*schema.JobMetric)
|
||||||
for i, res := range resBody.Results {
|
for i, res := range resBody.Results {
|
||||||
|
if len(res) == 0 {
|
||||||
|
// No Data Found For Metric, Logged in FetchData to Warn
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
var query APIQuery
|
var query APIQuery
|
||||||
if resBody.Queries != nil {
|
if resBody.Queries != nil {
|
||||||
query = resBody.Queries[i]
|
query = resBody.Queries[i]
|
||||||
@@ -572,7 +581,6 @@ func (ccms *CCMetricStore) LoadNodeData(
|
|||||||
metric := query.Metric
|
metric := query.Metric
|
||||||
qdata := res[0]
|
qdata := res[0]
|
||||||
if qdata.Error != nil {
|
if qdata.Error != nil {
|
||||||
/* Build list for "partial errors", if any */
|
|
||||||
errors = append(errors, fmt.Sprintf("fetching %s for node %s failed: %s", metric, query.Hostname, *qdata.Error))
|
errors = append(errors, fmt.Sprintf("fetching %s for node %s failed: %s", metric, query.Hostname, *qdata.Error))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user