mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 15:44:05 -08:00
Move check for empty memory series to separate method.
This commit is contained in:
parent
16364eda37
commit
008bc09da8
|
@ -141,6 +141,10 @@ func (s *stream) getRangeValues(in model.Interval) model.Values {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *stream) empty() bool {
|
||||||
|
return len(s.values) == 0
|
||||||
|
}
|
||||||
|
|
||||||
func newStream(metric model.Metric) *stream {
|
func newStream(metric model.Metric) *stream {
|
||||||
return &stream{
|
return &stream{
|
||||||
metric: metric,
|
metric: metric,
|
||||||
|
@ -258,7 +262,7 @@ func (s *memorySeriesStorage) Flush(flushOlderThan time.Time, queue chan<- model
|
||||||
|
|
||||||
s.Lock()
|
s.Lock()
|
||||||
for _, fingerprint := range emptySeries {
|
for _, fingerprint := range emptySeries {
|
||||||
if len(s.fingerprintToSeries[fingerprint].values) == 0 {
|
if s.fingerprintToSeries[fingerprint].empty() {
|
||||||
s.dropSeries(&fingerprint)
|
s.dropSeries(&fingerprint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue