mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 07:34:04 -08:00
Record the exact value of desired shards in metric
It is possible that desired shards is always a bit higher than the number of shards (less than 30%) and by exporting desired shards as the raw number it will be easy to tell if a Prometheus is in that situation. Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
This commit is contained in:
parent
0e684ca205
commit
6f34e35b3e
|
@ -565,6 +565,7 @@ func (t *QueueManager) calculateDesiredShards() int {
|
||||||
timePerSample = samplesOutDuration / samplesOutRate
|
timePerSample = samplesOutDuration / samplesOutRate
|
||||||
desiredShards = timePerSample * (samplesInRate + t.integralAccumulator)
|
desiredShards = timePerSample * (samplesInRate + t.integralAccumulator)
|
||||||
)
|
)
|
||||||
|
t.desiredNumShards.Set(desiredShards)
|
||||||
level.Debug(t.logger).Log("msg", "QueueManager.calculateDesiredShards",
|
level.Debug(t.logger).Log("msg", "QueueManager.calculateDesiredShards",
|
||||||
"samplesInRate", samplesInRate,
|
"samplesInRate", samplesInRate,
|
||||||
"samplesOutRate", samplesOutRate,
|
"samplesOutRate", samplesOutRate,
|
||||||
|
@ -591,7 +592,6 @@ func (t *QueueManager) calculateDesiredShards() int {
|
||||||
}
|
}
|
||||||
|
|
||||||
numShards := int(math.Ceil(desiredShards))
|
numShards := int(math.Ceil(desiredShards))
|
||||||
t.desiredNumShards.Set(float64(numShards))
|
|
||||||
if numShards > t.cfg.MaxShards {
|
if numShards > t.cfg.MaxShards {
|
||||||
numShards = t.cfg.MaxShards
|
numShards = t.cfg.MaxShards
|
||||||
} else if numShards < t.cfg.MinShards {
|
} else if numShards < t.cfg.MinShards {
|
||||||
|
|
Loading…
Reference in a new issue