MCPcopy
hub / github.com/prometheus/prometheus / samplesForRange

Function samplesForRange

tsdb/compact_test.go:539–552  ·  view source on GitHub ↗
(minTime, maxTime int64, maxSamplesPerChunk int)

Source from the content-addressed store, hash-verified

537func (nopChunkWriter) Close() error { return nil }
538
539func samplesForRange(minTime, maxTime int64, maxSamplesPerChunk int) (ret [][]sample) {
540 var curr []sample
541 for i := minTime; i <= maxTime; i++ {
542 curr = append(curr, sample{t: i})
543 if len(curr) >= maxSamplesPerChunk {
544 ret = append(ret, curr)
545 curr = []sample{}
546 }
547 }
548 if len(curr) > 0 {
549 ret = append(ret, curr)
550 }
551 return ret
552}
553
554func TestCompaction_populateBlock(t *testing.T) {
555 for _, tc := range []struct {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…