MCPcopy
hub / github.com/prometheus/prometheus / Seek

Method Seek

tsdb/querier.go:1301–1328  ·  view source on GitHub ↗
(t int64)

Source from the content-addressed store, hash-verified

1299}
1300
1301func (it *DeletedIterator) Seek(t int64) chunkenc.ValueType {
1302 if it.Iter.Err() != nil {
1303 return chunkenc.ValNone
1304 }
1305 valueType := it.Iter.Seek(t)
1306 if valueType == chunkenc.ValNone {
1307 return chunkenc.ValNone
1308 }
1309
1310 // Now double check if the entry falls into a deleted interval.
1311 ts := it.AtT()
1312 for _, itv := range it.Intervals {
1313 if ts < itv.Mint {
1314 return valueType
1315 }
1316
1317 if ts > itv.Maxt {
1318 it.Intervals = it.Intervals[1:]
1319 continue
1320 }
1321
1322 // We're in the middle of an interval, we can now call Next().
1323 return it.Next()
1324 }
1325
1326 // The timestamp is greater than all the deleted intervals.
1327 return valueType
1328}
1329
1330func (it *DeletedIterator) Next() chunkenc.ValueType {
1331Outer:

Callers 1

Calls 4

AtTMethod · 0.95
NextMethod · 0.95
ErrMethod · 0.65
SeekMethod · 0.65

Tested by 1