|
|
|
@ -301,7 +301,7 @@ func (s *memorySeriesStorage) WaitForIndexing() {
|
|
|
|
|
s.persistence.waitForIndexing()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NewIterator implements storage.
|
|
|
|
|
// NewIterator implements Storage.
|
|
|
|
|
func (s *memorySeriesStorage) NewIterator(fp clientmodel.Fingerprint) SeriesIterator {
|
|
|
|
|
s.fpLocker.Lock(fp)
|
|
|
|
|
defer s.fpLocker.Unlock(fp)
|
|
|
|
@ -321,6 +321,18 @@ func (s *memorySeriesStorage) NewIterator(fp clientmodel.Fingerprint) SeriesIter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LastSampleForFingerprint implements Storage.
|
|
|
|
|
func (s *memorySeriesStorage) LastSamplePairForFingerprint(fp clientmodel.Fingerprint) *metric.SamplePair {
|
|
|
|
|
s.fpLocker.Lock(fp)
|
|
|
|
|
defer s.fpLocker.Unlock(fp)
|
|
|
|
|
|
|
|
|
|
series, ok := s.fpToSeries.get(fp)
|
|
|
|
|
if !ok {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return series.head().lastSamplePair()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// boundedIterator wraps a SeriesIterator and does not allow fetching
|
|
|
|
|
// data from earlier than the configured start time.
|
|
|
|
|
type boundedIterator struct {
|
|
|
|
|