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
|
||||
}
|
||||
|
||||
func (s *stream) empty() bool {
|
||||
return len(s.values) == 0
|
||||
}
|
||||
|
||||
func newStream(metric model.Metric) *stream {
|
||||
return &stream{
|
||||
metric: metric,
|
||||
|
@ -258,7 +262,7 @@ func (s *memorySeriesStorage) Flush(flushOlderThan time.Time, queue chan<- model
|
|||
|
||||
s.Lock()
|
||||
for _, fingerprint := range emptySeries {
|
||||
if len(s.fingerprintToSeries[fingerprint].values) == 0 {
|
||||
if s.fingerprintToSeries[fingerprint].empty() {
|
||||
s.dropSeries(&fingerprint)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue