Interface simplifications: GetRangeValues

From pointers to copies.
This commit is contained in:
Matt T. Proud 2013-02-13 21:11:23 -08:00
parent 14788cf4f3
commit f03091b139
4 changed files with 5 additions and 5 deletions

View file

@ -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
}

View file

@ -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)

View file

@ -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() {

View file

@ -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)
}