mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
Interface simplifications: GetRangeValues
From pointers to copies.
This commit is contained in:
parent
14788cf4f3
commit
f03091b139
|
@ -74,7 +74,7 @@ func (p *PersistenceAdapter) GetBoundaryValues(labels model.LabelSet, interval *
|
|||
sampleSets := []*model.SampleSet{}
|
||||
for _, metric := range metrics {
|
||||
// TODO: change to GetBoundaryValues() once it has the right return type.
|
||||
sampleSet, err := p.persistence.GetRangeValues(metric, interval, p.stalenessPolicy)
|
||||
sampleSet, err := p.persistence.GetRangeValues(*metric, *interval, *p.stalenessPolicy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ func (p *PersistenceAdapter) GetRangeValues(labels model.LabelSet, interval *mod
|
|||
|
||||
sampleSets := []*model.SampleSet{}
|
||||
for _, metric := range metrics {
|
||||
sampleSet, err := p.persistence.GetRangeValues(metric, interval, p.stalenessPolicy)
|
||||
sampleSet, err := p.persistence.GetRangeValues(*metric, *interval, *p.stalenessPolicy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ type MetricPersistence interface {
|
|||
|
||||
GetValueAtTime(model.Metric, time.Time, StalenessPolicy) (*model.Sample, error)
|
||||
GetBoundaryValues(model.Metric, model.Interval, StalenessPolicy) (*model.Sample, *model.Sample, error)
|
||||
GetRangeValues(*model.Metric, *model.Interval, *StalenessPolicy) (*model.SampleSet, error)
|
||||
GetRangeValues(model.Metric, model.Interval, StalenessPolicy) (*model.SampleSet, error)
|
||||
|
||||
GetAllMetricNames() ([]string, error)
|
||||
|
||||
|
|
|
@ -553,7 +553,7 @@ func (l *LevelDBMetricPersistence) GetValueAtTime(m model.Metric, t time.Time, s
|
|||
return
|
||||
}
|
||||
|
||||
func (l *LevelDBMetricPersistence) GetRangeValues(m *model.Metric, i *model.Interval, s *metric.StalenessPolicy) (v *model.SampleSet, err error) {
|
||||
func (l *LevelDBMetricPersistence) GetRangeValues(m model.Metric, i model.Interval, s metric.StalenessPolicy) (v *model.SampleSet, err error) {
|
||||
begin := time.Now()
|
||||
|
||||
defer func() {
|
||||
|
|
|
@ -1652,7 +1652,7 @@ var testGetRangeValues = func(t test.Tester) {
|
|||
DeltaAllowance: input.staleness,
|
||||
}
|
||||
|
||||
values, err := persistence.GetRangeValues(&m, &i, &p)
|
||||
values, err := persistence.GetRangeValues(m, i, p)
|
||||
if err != nil {
|
||||
t.Errorf("%d.%d(%s). Could not query for value: %q\n", i, j, behavior.name, err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue