mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Fix tests for append API changes
This commit is contained in:
parent
59f1e722df
commit
d0d2c38c68
|
@ -21,7 +21,8 @@ import (
|
||||||
|
|
||||||
type nopAppender struct{}
|
type nopAppender struct{}
|
||||||
|
|
||||||
func (a nopAppender) Append(*model.Sample) {
|
func (a nopAppender) Append(*model.Sample) error {
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a nopAppender) NeedsThrottling() bool {
|
func (a nopAppender) NeedsThrottling() bool {
|
||||||
|
@ -33,13 +34,14 @@ type collectResultAppender struct {
|
||||||
throttled bool
|
throttled bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *collectResultAppender) Append(s *model.Sample) {
|
func (a *collectResultAppender) Append(s *model.Sample) error {
|
||||||
for ln, lv := range s.Metric {
|
for ln, lv := range s.Metric {
|
||||||
if len(lv) == 0 {
|
if len(lv) == 0 {
|
||||||
delete(s.Metric, ln)
|
delete(s.Metric, ln)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
a.result = append(a.result, s)
|
a.result = append(a.result, s)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *collectResultAppender) NeedsThrottling() bool {
|
func (a *collectResultAppender) NeedsThrottling() bool {
|
||||||
|
|
Loading…
Reference in a new issue