Handle the metric/host not found case differently

This commit is contained in:
Aditya Ujeniya
2026-01-28 17:47:38 +01:00
parent 3452891613
commit 7101d2bb3b
3 changed files with 43 additions and 5 deletions

View File

@@ -699,7 +699,7 @@ func (m *MemoryStore) Read(selector util.Selector, metric string, from, to, reso
if err != nil {
return nil, 0, 0, 0, err
} else if n == 0 {
return nil, 0, 0, 0, errors.New("[METRICSTORE]> metric or host not found")
return nil, 0, 0, 0, ErrNoHostOrMetric
} else if n > 1 {
if minfo.Aggregation == AvgAggregation {
normalize := 1. / schema.Float(n)