mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
Correctly update chunksRemoved and chunks metrics
Signed-off-by: fayzal-g <fayzal.ghantiwala@grafana.com>
This commit is contained in:
parent
9f91215bf6
commit
cfa4ea53cc
|
@ -498,6 +498,12 @@ func (h *Head) resetSeriesWithMMappedChunks(mSeries *memSeries, mmc, oooMmc []*m
|
||||||
h.metrics.chunksCreated.Add(float64(len(mmc) + len(oooMmc)))
|
h.metrics.chunksCreated.Add(float64(len(mmc) + len(oooMmc)))
|
||||||
h.metrics.chunksRemoved.Add(float64(len(mSeries.mmappedChunks)))
|
h.metrics.chunksRemoved.Add(float64(len(mSeries.mmappedChunks)))
|
||||||
h.metrics.chunks.Add(float64(len(mmc) + len(oooMmc) - len(mSeries.mmappedChunks)))
|
h.metrics.chunks.Add(float64(len(mmc) + len(oooMmc) - len(mSeries.mmappedChunks)))
|
||||||
|
|
||||||
|
if mSeries.ooo != nil {
|
||||||
|
h.metrics.chunksRemoved.Add(float64(len(mSeries.ooo.oooMmappedChunks)))
|
||||||
|
h.metrics.chunks.Sub(float64(len(mSeries.ooo.oooMmappedChunks)))
|
||||||
|
}
|
||||||
|
|
||||||
mSeries.mmappedChunks = mmc
|
mSeries.mmappedChunks = mmc
|
||||||
if len(oooMmc) == 0 {
|
if len(oooMmc) == 0 {
|
||||||
mSeries.ooo = nil
|
mSeries.ooo = nil
|
||||||
|
|
Loading…
Reference in a new issue