mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Simplify code, fix typos. (#2719)
This commit is contained in:
parent
61235fd851
commit
b0e1ea7c6c
|
@ -41,7 +41,7 @@ func TestAlertingRuleHTMLSnippet(t *testing.T) {
|
||||||
func TestCurrentAlertsClonesLabelsAndAnnotations(t *testing.T) {
|
func TestCurrentAlertsClonesLabelsAndAnnotations(t *testing.T) {
|
||||||
r := AlertingRule{
|
r := AlertingRule{
|
||||||
active: map[model.Fingerprint]*Alert{
|
active: map[model.Fingerprint]*Alert{
|
||||||
0: &Alert{
|
0: {
|
||||||
Labels: model.LabelSet{"test_label": "test_label_value"},
|
Labels: model.LabelSet{"test_label": "test_label_value"},
|
||||||
Annotations: model.LabelSet{"test_annotation": "test_annotation_value"},
|
Annotations: model.LabelSet{"test_annotation": "test_annotation_value"},
|
||||||
},
|
},
|
||||||
|
|
|
@ -323,7 +323,7 @@ func (t *QueueManager) calculateDesiredShards() {
|
||||||
timePerSample = samplesOutDuration / samplesOut
|
timePerSample = samplesOutDuration / samplesOut
|
||||||
desiredShards = (timePerSample * (samplesIn + samplesPending + t.integralAccumulator)) / float64(time.Second)
|
desiredShards = (timePerSample * (samplesIn + samplesPending + t.integralAccumulator)) / float64(time.Second)
|
||||||
)
|
)
|
||||||
log.Debugf("QueueManager.caclulateDesiredShards samplesIn=%f, samplesOut=%f, samplesPending=%f, desiredShards=%f",
|
log.Debugf("QueueManager.calculateDesiredShards samplesIn=%f, samplesOut=%f, samplesPending=%f, desiredShards=%f",
|
||||||
samplesIn, samplesOut, samplesPending, desiredShards)
|
samplesIn, samplesOut, samplesPending, desiredShards)
|
||||||
|
|
||||||
// Changes in the number of shards must be greater than shardToleranceFraction.
|
// Changes in the number of shards must be greater than shardToleranceFraction.
|
||||||
|
@ -478,7 +478,7 @@ func (s *shards) sendSamples(samples model.Samples) {
|
||||||
begin := time.Now()
|
begin := time.Now()
|
||||||
s.sendSamplesWithBackoff(samples)
|
s.sendSamplesWithBackoff(samples)
|
||||||
|
|
||||||
// These counters are used to caclulate the dynamic sharding, and as such
|
// These counters are used to calculate the dynamic sharding, and as such
|
||||||
// should be maintained irrespective of success or failure.
|
// should be maintained irrespective of success or failure.
|
||||||
s.qm.samplesOut.incr(int64(len(samples)))
|
s.qm.samplesOut.incr(int64(len(samples)))
|
||||||
s.qm.samplesOutDuration.incr(int64(time.Since(begin)))
|
s.qm.samplesOutDuration.incr(int64(time.Since(begin)))
|
||||||
|
|
Loading…
Reference in a new issue