Interface simplifications.

GetBoundaryValues() from pointers to values.
This commit is contained in:
Matt T. Proud 2013-02-13 21:07:42 -08:00
parent 56f069b3ec
commit 14788cf4f3
3 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@ type MetricPersistence interface {
GetMetricForFingerprint(model.Fingerprint) (*model.Metric, error)
GetValueAtTime(model.Metric, time.Time, StalenessPolicy) (*model.Sample, error)
GetBoundaryValues(*model.Metric, *model.Interval, *StalenessPolicy) (*model.Sample, *model.Sample, error)
GetBoundaryValues(model.Metric, model.Interval, StalenessPolicy) (*model.Sample, *model.Sample, error)
GetRangeValues(*model.Metric, *model.Interval, *StalenessPolicy) (*model.SampleSet, error)
GetAllMetricNames() ([]string, error)

View File

@ -290,7 +290,7 @@ func (l *LevelDBMetricPersistence) GetMetricForFingerprint(f model.Fingerprint)
return
}
func (l *LevelDBMetricPersistence) GetBoundaryValues(m *model.Metric, i *model.Interval, s *metric.StalenessPolicy) (open *model.Sample, end *model.Sample, err error) {
func (l *LevelDBMetricPersistence) GetBoundaryValues(m model.Metric, i model.Interval, s metric.StalenessPolicy) (open *model.Sample, end *model.Sample, err error) {
begin := time.Now()
defer func() {
@ -300,14 +300,14 @@ func (l *LevelDBMetricPersistence) GetBoundaryValues(m *model.Metric, i *model.I
}()
// XXX: Maybe we will want to emit incomplete sets?
open, err = l.GetValueAtTime(*m, i.OldestInclusive, *s)
open, err = l.GetValueAtTime(m, i.OldestInclusive, s)
if err != nil {
return
} else if open == nil {
return
}
end, err = l.GetValueAtTime(*m, i.NewestInclusive, *s)
end, err = l.GetValueAtTime(m, i.NewestInclusive, s)
if err != nil {
return
} else if end == nil {

View File

@ -1058,7 +1058,7 @@ var testGetBoundaryValues = func(t test.Tester) {
DeltaAllowance: input.staleness,
}
openValue, endValue, err := persistence.GetBoundaryValues(&m, &interval, &p)
openValue, endValue, err := persistence.GetBoundaryValues(m, interval, p)
if err != nil {
t.Errorf("%d.%d(%s). Could not query for value: %q\n", i, j, behavior.name, err)
}