mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2024-12-28 01:29:05 +01:00
Fix panic in findBuffers when Any pattern is used
This commit is contained in:
parent
61f9056781
commit
fee0061172
@ -375,7 +375,7 @@ func (m *MemoryStore) Read(selector Selector, metric string, from, to int64) ([]
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, 0, 0, err
|
return nil, 0, 0, err
|
||||||
} else if n == 0 {
|
} else if n == 0 {
|
||||||
return nil, 0, 0, errors.New("metric not found")
|
return nil, 0, 0, errors.New("metric or host not found")
|
||||||
} else if n > 1 {
|
} else if n > 1 {
|
||||||
if minfo.aggregation == AvgAggregation {
|
if minfo.aggregation == AvgAggregation {
|
||||||
normalize := 1. / Float(n)
|
normalize := 1. / Float(n)
|
||||||
|
@ -111,6 +111,7 @@ func (l *level) findBuffers(selector Selector, offset int, f func(b *buffer) err
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
panic("impossible")
|
panic("impossible")
|
||||||
|
Loading…
Reference in New Issue
Block a user