From 17f15d024a495d07033deed4a09d7d98dcbf89ff Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Wed, 5 Apr 2017 16:24:22 +0300 Subject: [PATCH] Small fixes. (#2578) Fix typos. Simplify with gofmt -s --- retrieval/scrape.go | 2 +- storage/fanin/fanin_test.go | 14 +++++++------- storage/local/storage.go | 2 +- web/api/v1/api_test.go | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/retrieval/scrape.go b/retrieval/scrape.go index 7b7a68bed..f67957cd8 100644 --- a/retrieval/scrape.go +++ b/retrieval/scrape.go @@ -500,7 +500,7 @@ func (sl *scrapeLoop) append(samples model.Samples) (int, error) { var wrappedBufApp storage.SampleAppender wrappedBufApp, countingApp = sl.wrapAppender(bufApp) for _, s := range samples { - // Ignore errors as bufferedAppender always succeds. + // Ignore errors as bufferedAppender always succeeds. wrappedBufApp.Append(s) } samples = bufApp.buffer diff --git a/storage/fanin/fanin_test.go b/storage/fanin/fanin_test.go index a95972e70..5115b745f 100644 --- a/storage/fanin/fanin_test.go +++ b/storage/fanin/fanin_test.go @@ -143,7 +143,7 @@ func TestQueryRange(t *testing.T) { }, }, remote: []model.Matrix{ - model.Matrix{ + { &model.SampleStream{ Metric: model.Metric{ model.MetricNameLabel: "testmetric", @@ -164,7 +164,7 @@ func TestQueryRange(t *testing.T) { }, }, }, - model.Matrix{ + { &model.SampleStream{ Metric: model.Metric{ model.MetricNameLabel: "testmetric", @@ -231,7 +231,7 @@ func TestQueryRange(t *testing.T) { }, }, remote: []model.Matrix{ - model.Matrix{ + { &model.SampleStream{ Metric: model.Metric{ model.MetricNameLabel: "testmetric", @@ -252,7 +252,7 @@ func TestQueryRange(t *testing.T) { }, }, }, - model.Matrix{ + { &model.SampleStream{ Metric: model.Metric{ model.MetricNameLabel: "testmetric", @@ -323,7 +323,7 @@ func TestQueryRange(t *testing.T) { { name: "no local data", remote: []model.Matrix{ - model.Matrix{ + { &model.SampleStream{ Metric: model.Metric{ model.MetricNameLabel: "testmetric", @@ -345,7 +345,7 @@ func TestQueryRange(t *testing.T) { }, }, }, - model.Matrix{ + { &model.SampleStream{ Metric: model.Metric{ model.MetricNameLabel: "testmetric", @@ -507,7 +507,7 @@ func TestQueryRange(t *testing.T) { }, }, remote: []model.Matrix{ - model.Matrix{ + { &model.SampleStream{ Metric: model.Metric{ model.MetricNameLabel: "testmetric", diff --git a/storage/local/storage.go b/storage/local/storage.go index ce72a115d..574808055 100644 --- a/storage/local/storage.go +++ b/storage/local/storage.go @@ -1209,7 +1209,7 @@ func (s *MemorySeriesStorage) maybeEvict() { // to 1 to signal that we want to evict chunk but have no evictable chunks // available. // -// - Otherwise, calulate the number of chunks to evict and return it: +// - Otherwise, calculate the number of chunks to evict and return it: // // MAX( h(nextGC), h(current) ) - h(target) // n(toEvict) = MIN( n(evictable), ---------------------------------------- ) diff --git a/web/api/v1/api_test.go b/web/api/v1/api_test.go index 3a26c83ac..fd849628f 100644 --- a/web/api/v1/api_test.go +++ b/web/api/v1/api_test.go @@ -453,7 +453,7 @@ func TestEndpoints(t *testing.T) { endpoint: api.targets, response: &TargetDiscovery{ ActiveTargets: []*Target{ - &Target{ + { DiscoveredLabels: model.LabelSet{}, Labels: model.LabelSet{}, ScrapeURL: "http://example.com:8080/metrics", @@ -465,7 +465,7 @@ func TestEndpoints(t *testing.T) { endpoint: api.alertmanagers, response: &AlertmanagerDiscovery{ ActiveAlertmanagers: []*AlertmanagerTarget{ - &AlertmanagerTarget{ + { URL: "http://alertmanager.example.com:8080/api/v1/alerts", }, },