From e50de005f9bb8359e35079d63be9449d9986dcc4 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Mon, 18 Mar 2013 17:11:23 +0100 Subject: [PATCH] Populate metric in SampleSet returned from GetRangeValues() --- storage/metric/leveldb.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/storage/metric/leveldb.go b/storage/metric/leveldb.go index ca824529f..c7bdbf914 100644 --- a/storage/metric/leveldb.go +++ b/storage/metric/leveldb.go @@ -1220,7 +1220,14 @@ func (l *LevelDBMetricPersistence) GetRangeValues(fp model.Fingerprint, i model. } if v == nil { - v = &model.SampleSet{} + // TODO: memoize/cache this or change the return type to metric.SamplePair. + m, err := l.GetMetricForFingerprint(fp) + if err != nil { + return v, err + } + v = &model.SampleSet{ + Metric: *m, + } } v.Values = append(v.Values, model.SamplePair{