Browse Source

scrape: remove unused type (#5761)

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
pull/5705/head
Simon Pasquier 5 years ago committed by GitHub
parent
commit
9a1935d641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      scrape/helpers_test.go
  2. 22
      scrape/scrape.go

6
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 {

22
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()

Loading…
Cancel
Save