prometheus/cmd/promtool
Fiona Liao 5bee0cfce2
Change `ChunkReader.Chunk()` to `ChunkOrIterable()`
The ChunkReader interface's Chunk() has been changed to ChunkOrIterable(). 

This is a precursor to OOO native histogram support - with OOO native histograms, the chunks.Meta passed to Chunk() can result in multiple chunks being returned rather than just a single chunk (e.g. if oooMergedChunk has a counter reset in the middle). 

To support this, ChunkOrIterable() requires either a single chunk or an iterable to be returned. If an iterable is returned, the caller has the responsibility of converting the samples from the iterable into possibly multiple chunks. The OOOHeadChunkReader now returns an iterable rather than a chunk to prepare for the native histograms case. Also as a beneficial side effect, oooMergedChunk and boundedChunk has been simplified as they only need to implement the Iterable interface now, not the full Chunk interface.

---------

Signed-off-by: Fiona Liao <fiona.y.liao@gmail.com>
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
2023-11-28 11:14:29 +01:00
..
testdata Set test group interval default to evaluation interval (#13011) 2023-10-20 21:32:46 +11:00
archive.go refactor (package cmd): move from github.com/pkg/errors to 'errors' and 'fmt' packages (#10733) 2022-05-24 16:58:59 +10:00
backfill.go enable gocritic, unconvert and unused linters 2023-04-13 19:20:22 +00:00
backfill_test.go ci(lint): enable nolintlint and remove redundant comments (#12926) 2023-10-31 12:35:13 +01:00
debug.go refactor (package cmd): move from github.com/pkg/errors to 'errors' and 'fmt' packages (#10733) 2022-05-24 16:58:59 +10:00
main.go ci(lint): enable nolintlint and remove redundant comments (#12926) 2023-10-31 12:35:13 +01:00
main_test.go ci(lint): enable errorlint linter on cmd 2023-09-28 08:21:01 +00:00
metrics.go Add a header to count retried remote write requests (#12729) 2023-09-20 11:11:03 +01:00
rules.go Merge branch 'main' into linter/nilerr 2023-04-19 19:56:39 +02:00
rules_test.go ci(lint): enable nolintlint and remove redundant comments (#12926) 2023-10-31 12:35:13 +01:00
sd.go Merge pull request #12048 from bboreham/faster-targets 2023-03-09 11:10:01 +00:00
sd_test.go cmd/promtool: in tests use labels.FromStrings 2022-09-09 13:34:49 +02:00
tsdb.go Change `ChunkReader.Chunk()` to `ChunkOrIterable()` 2023-11-28 11:14:29 +01:00
tsdb_test.go enhance promtool tsdb analyze command (#12869) 2023-10-14 20:34:50 +02:00
unittest.go Set test group interval default to evaluation interval (#13011) 2023-10-20 21:32:46 +11:00
unittest_test.go Set test group interval default to evaluation interval (#13011) 2023-10-20 21:32:46 +11:00