prometheus/tsdb/index
Baskar Shanmugam f731a90a7f
Fix LabelValueStats in posting stats (#12342)
Problem:
LabelValueStats - This will provide a list of the label names and memory used in bytes.
It is calculated by adding the length of all values for a given label name.
But internally Prometheus stores the name and the value independently for each series.

Solution:
MemPostings struct maintains the values to seriesRef map which is used
to get the number of series which contains the label values.
Using that LabelValueStats is calculated as: seriesCnt * len(value
name)

Signed-off-by: Baskar Shanmugam <baskar.shanmugam.career@gmail.com>
2023-05-19 09:36:30 +02:00
..
index_test.go Simplify IndexReader.Series interface 2022-12-19 15:22:09 +00:00
index.go enable gocritic, unconvert and unused linters 2023-04-13 19:20:22 +00:00
postings_test.go Fix LabelValueStats in posting stats (#12342) 2023-05-19 09:36:30 +02:00
postings.go Fix LabelValueStats in posting stats (#12342) 2023-05-19 09:36:30 +02:00
postingsstats_test.go Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
postingsstats.go enable gocritic, unconvert and unused linters 2023-04-13 19:20:22 +00:00