mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 07:34:04 -08:00
Changed to open_head_chunks to address review.
Now incrementing numHeadChunks directly.
This commit is contained in:
parent
074050b8c0
commit
025c828976
|
@ -258,7 +258,7 @@ func NewMemorySeriesStorage(o *MemorySeriesStorageOptions) *MemorySeriesStorage
|
||||||
numHeadChunks: prometheus.NewGauge(prometheus.GaugeOpts{
|
numHeadChunks: prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Subsystem: subsystem,
|
Subsystem: subsystem,
|
||||||
Name: "num_head_chunks_open",
|
Name: "open_head_chunks",
|
||||||
Help: "The current number of open head chunks.",
|
Help: "The current number of open head chunks.",
|
||||||
}),
|
}),
|
||||||
dirtySeries: prometheus.NewGauge(prometheus.GaugeOpts{
|
dirtySeries: prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
|
@ -379,15 +379,13 @@ func (s *MemorySeriesStorage) Start() (err error) {
|
||||||
|
|
||||||
log.Info("Loading series map and head chunks...")
|
log.Info("Loading series map and head chunks...")
|
||||||
s.fpToSeries, s.numChunksToPersist, err = p.loadSeriesMapAndHeads()
|
s.fpToSeries, s.numChunksToPersist, err = p.loadSeriesMapAndHeads()
|
||||||
openHeadCount := 0
|
|
||||||
for fp := range s.fpToSeries.fpIter() {
|
for fp := range s.fpToSeries.fpIter() {
|
||||||
if series, ok := s.fpToSeries.get(fp); ok {
|
if series, ok := s.fpToSeries.get(fp); ok {
|
||||||
if !series.headChunkClosed {
|
if !series.headChunkClosed {
|
||||||
openHeadCount++
|
s.numHeadChunks.Inc()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s.numHeadChunks.Set(float64(openHeadCount))
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue