"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "storage/remote/queue_manager.go" between
prometheus-2.19.1.tar.gz and prometheus-2.19.2.tar.gz

About: Prometheus is a monitoring system, alerting toolkit and time series database.

queue_manager.go  (prometheus-2.19.1):queue_manager.go  (prometheus-2.19.2)
skipping to change at line 180 skipping to change at line 180
ConstLabels: constLabels, ConstLabels: constLabels,
}) })
m.bytesSent = prometheus.NewCounter(prometheus.CounterOpts{ m.bytesSent = prometheus.NewCounter(prometheus.CounterOpts{
Namespace: namespace, Namespace: namespace,
Subsystem: subsystem, Subsystem: subsystem,
Name: "sent_bytes_total", Name: "sent_bytes_total",
Help: "The total number of bytes sent by the queue.", Help: "The total number of bytes sent by the queue.",
ConstLabels: constLabels, ConstLabels: constLabels,
}) })
if r != nil { return m
r.MustRegister( }
func (m *queueManagerMetrics) register() {
if m.reg != nil {
m.reg.MustRegister(
m.succeededSamplesTotal, m.succeededSamplesTotal,
m.failedSamplesTotal, m.failedSamplesTotal,
m.retriedSamplesTotal, m.retriedSamplesTotal,
m.droppedSamplesTotal, m.droppedSamplesTotal,
m.enqueueRetriesTotal, m.enqueueRetriesTotal,
m.sentBatchDuration, m.sentBatchDuration,
m.highestSentTimestamp, m.highestSentTimestamp,
m.pendingSamples, m.pendingSamples,
m.shardCapacity, m.shardCapacity,
m.numShards, m.numShards,
m.maxNumShards, m.maxNumShards,
m.minNumShards, m.minNumShards,
m.desiredNumShards, m.desiredNumShards,
m.bytesSent, m.bytesSent,
) )
} }
return m
} }
func (m *queueManagerMetrics) unregister() { func (m *queueManagerMetrics) unregister() {
if m.reg != nil { if m.reg != nil {
m.reg.Unregister(m.succeededSamplesTotal) m.reg.Unregister(m.succeededSamplesTotal)
m.reg.Unregister(m.failedSamplesTotal) m.reg.Unregister(m.failedSamplesTotal)
m.reg.Unregister(m.retriedSamplesTotal) m.reg.Unregister(m.retriedSamplesTotal)
m.reg.Unregister(m.droppedSamplesTotal) m.reg.Unregister(m.droppedSamplesTotal)
m.reg.Unregister(m.enqueueRetriesTotal) m.reg.Unregister(m.enqueueRetriesTotal)
m.reg.Unregister(m.sentBatchDuration) m.reg.Unregister(m.sentBatchDuration)
skipping to change at line 361 skipping to change at line 364
backoff = t.cfg.MaxBackoff backoff = t.cfg.MaxBackoff
} }
} }
} }
return true return true
} }
// Start the queue manager sending samples to the remote storage. // Start the queue manager sending samples to the remote storage.
// Does not block. // Does not block.
func (t *QueueManager) Start() { func (t *QueueManager) Start() {
// Initialise some metrics. // Register and initialise some metrics.
t.metrics.register()
t.metrics.shardCapacity.Set(float64(t.cfg.Capacity)) t.metrics.shardCapacity.Set(float64(t.cfg.Capacity))
t.metrics.pendingSamples.Set(0) t.metrics.pendingSamples.Set(0)
t.metrics.maxNumShards.Set(float64(t.cfg.MaxShards)) t.metrics.maxNumShards.Set(float64(t.cfg.MaxShards))
t.metrics.minNumShards.Set(float64(t.cfg.MinShards)) t.metrics.minNumShards.Set(float64(t.cfg.MinShards))
t.metrics.desiredNumShards.Set(float64(t.cfg.MinShards)) t.metrics.desiredNumShards.Set(float64(t.cfg.MinShards))
t.shards.start(t.numShards) t.shards.start(t.numShards)
t.watcher.Start() t.watcher.Start()
t.wg.Add(2) t.wg.Add(2)
 End of changes. 3 change blocks. 
4 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)