Populate metric in SampleSet returned from GetRangeValues()

This commit is contained in:
Julius Volz 2013-03-18 17:11:23 +01:00 committed by Matt T. Proud
parent 6001d22f87
commit e50de005f9
1 changed files with 8 additions and 1 deletions

View File

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