mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
scrape: remove unused type (#5761)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
fb6c709a5e
commit
9a1935d641
|
@ -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 {
|
||||
|
|
|
@ -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…
Reference in a new issue