mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
remote: Improve some comments (#12102)
Improve some comments in storage/remote/queue_manager.go, wrt. general language and a typo. Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
parent
479fde5bf1
commit
bc9a82f5a1
|
@ -454,7 +454,7 @@ func NewQueueManager(
|
||||||
logger = log.NewNopLogger()
|
logger = log.NewNopLogger()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy externalLabels into slice which we need for processExternalLabels.
|
// Copy externalLabels into a slice, which we need for processExternalLabels.
|
||||||
extLabelsSlice := make([]labels.Label, 0, externalLabels.Len())
|
extLabelsSlice := make([]labels.Label, 0, externalLabels.Len())
|
||||||
externalLabels.Range(func(l labels.Label) {
|
externalLabels.Range(func(l labels.Label) {
|
||||||
extLabelsSlice = append(extLabelsSlice, l)
|
extLabelsSlice = append(extLabelsSlice, l)
|
||||||
|
@ -499,7 +499,7 @@ func NewQueueManager(
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
// AppendMetadata sends metadata the remote storage. Metadata is sent in batches, but is not parallelized.
|
// AppendMetadata sends metadata to the remote storage. Metadata is sent in batches, but is not parallelized.
|
||||||
func (t *QueueManager) AppendMetadata(ctx context.Context, metadata []scrape.MetricMetadata) {
|
func (t *QueueManager) AppendMetadata(ctx context.Context, metadata []scrape.MetricMetadata) {
|
||||||
mm := make([]prompb.MetricMetadata, 0, len(metadata))
|
mm := make([]prompb.MetricMetadata, 0, len(metadata))
|
||||||
for _, entry := range metadata {
|
for _, entry := range metadata {
|
||||||
|
@ -944,7 +944,7 @@ func (t *QueueManager) updateShardsLoop() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// shouldReshard returns if resharding should occur
|
// shouldReshard returns whether resharding should occur.
|
||||||
func (t *QueueManager) shouldReshard(desiredShards int) bool {
|
func (t *QueueManager) shouldReshard(desiredShards int) bool {
|
||||||
if desiredShards == t.numShards {
|
if desiredShards == t.numShards {
|
||||||
return false
|
return false
|
||||||
|
@ -1471,7 +1471,7 @@ func (s *shards) sendSamples(ctx context.Context, samples []prompb.TimeSeries, s
|
||||||
s.qm.dataOut.incr(int64(len(samples)))
|
s.qm.dataOut.incr(int64(len(samples)))
|
||||||
s.qm.dataOutDuration.incr(int64(time.Since(begin)))
|
s.qm.dataOutDuration.incr(int64(time.Since(begin)))
|
||||||
s.qm.lastSendTimestamp.Store(time.Now().Unix())
|
s.qm.lastSendTimestamp.Store(time.Now().Unix())
|
||||||
// Pending samples/exemplars/histograms also should be subtracted as an error means
|
// Pending samples/exemplars/histograms also should be subtracted, as an error means
|
||||||
// they will not be retried.
|
// they will not be retried.
|
||||||
s.qm.metrics.pendingSamples.Sub(float64(sampleCount))
|
s.qm.metrics.pendingSamples.Sub(float64(sampleCount))
|
||||||
s.qm.metrics.pendingExemplars.Sub(float64(exemplarCount))
|
s.qm.metrics.pendingExemplars.Sub(float64(exemplarCount))
|
||||||
|
|
Loading…
Reference in a new issue