From 14788cf4f30f29db77e7353b030597757fb97d57 Mon Sep 17 00:00:00 2001 From: "Matt T. Proud" Date: Wed, 13 Feb 2013 21:07:42 -0800 Subject: [PATCH] Interface simplifications. GetBoundaryValues() from pointers to values. --- storage/metric/interface.go | 2 +- storage/metric/leveldb/reading.go | 6 +++--- storage/metric/leveldb/rule_integration_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/metric/interface.go b/storage/metric/interface.go index 379988c07..a3c58ceb8 100644 --- a/storage/metric/interface.go +++ b/storage/metric/interface.go @@ -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) diff --git a/storage/metric/leveldb/reading.go b/storage/metric/leveldb/reading.go index 0be23a20e..a0a0952aa 100644 --- a/storage/metric/leveldb/reading.go +++ b/storage/metric/leveldb/reading.go @@ -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 { diff --git a/storage/metric/leveldb/rule_integration_test.go b/storage/metric/leveldb/rule_integration_test.go index 9b25a4762..14beb6884 100644 --- a/storage/metric/leveldb/rule_integration_test.go +++ b/storage/metric/leveldb/rule_integration_test.go @@ -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) }