From b0e1ea7c6c27f0a0c5cdfab01225f9d5e6eb589b Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Mon, 15 May 2017 11:56:09 +0300 Subject: [PATCH] Simplify code, fix typos. (#2719) --- rules/alerting_test.go | 2 +- storage/remote/queue_manager.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rules/alerting_test.go b/rules/alerting_test.go index c06a40c9f..3f7d4953f 100644 --- a/rules/alerting_test.go +++ b/rules/alerting_test.go @@ -41,7 +41,7 @@ func TestAlertingRuleHTMLSnippet(t *testing.T) { func TestCurrentAlertsClonesLabelsAndAnnotations(t *testing.T) { r := AlertingRule{ active: map[model.Fingerprint]*Alert{ - 0: &Alert{ + 0: { Labels: model.LabelSet{"test_label": "test_label_value"}, Annotations: model.LabelSet{"test_annotation": "test_annotation_value"}, }, diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index 6813566a4..40c5a5eb4 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -323,7 +323,7 @@ func (t *QueueManager) calculateDesiredShards() { timePerSample = samplesOutDuration / samplesOut 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) // 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() 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. s.qm.samplesOut.incr(int64(len(samples))) s.qm.samplesOutDuration.incr(int64(time.Since(begin)))