From 9a1935d641d880cb8dee4ef01d319568aff65093 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Mon, 15 Jul 2019 08:54:22 +0200 Subject: [PATCH] scrape: remove unused type (#5761) Signed-off-by: Simon Pasquier --- scrape/helpers_test.go | 6 ++++++ scrape/scrape.go | 22 ---------------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/scrape/helpers_test.go b/scrape/helpers_test.go index f1e5471df..903c40688 100644 --- a/scrape/helpers_test.go +++ b/scrape/helpers_test.go @@ -31,6 +31,12 @@ func (a nopAppender) AddFast(labels.Labels, uint64, int64, float64) error { retu func (a nopAppender) Commit() error { return nil } func (a nopAppender) Rollback() error { return nil } +type sample struct { + metric labels.Labels + t int64 + v float64 +} + // collectResultAppender records all samples that were added through the appender. // It can be used as its zero value or be backed by another appender it writes samples through. type collectResultAppender struct { diff --git a/scrape/scrape.go b/scrape/scrape.go index a5c2183de..eca3229c9 100644 --- a/scrape/scrape.go +++ b/scrape/scrape.go @@ -1023,28 +1023,6 @@ func (sl *scrapeLoop) stop() { <-sl.stopped } -type sample struct { - metric labels.Labels - t int64 - v float64 -} - -//lint:ignore U1000 staticcheck falsely reports that samples is unused. -type samples []sample - -func (s samples) Len() int { return len(s) } -func (s samples) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -func (s samples) Less(i, j int) bool { - d := labels.Compare(s[i].metric, s[j].metric) - if d < 0 { - return true - } else if d > 0 { - return false - } - return s[i].t < s[j].t -} - func (sl *scrapeLoop) append(b []byte, contentType string, ts time.Time) (total, added, seriesAdded int, err error) { var ( app = sl.appender()