diff --git a/rules/ast/persistence_adapter.go b/rules/ast/persistence_adapter.go index d0c1c61f8..2ca1b37d2 100644 --- a/rules/ast/persistence_adapter.go +++ b/rules/ast/persistence_adapter.go @@ -37,7 +37,7 @@ func (p *PersistenceAdapter) getMetricsWithLabels(labels model.LabelSet) ([]*mod } metrics := []*model.Metric{} for _, fingerprint := range fingerprints { - metric, err := p.persistence.GetMetricForFingerprint(*fingerprint) + metric, err := p.persistence.GetMetricForFingerprint(fingerprint) if err != nil { return nil, err } diff --git a/storage/metric/interface.go b/storage/metric/interface.go index 74c4416c2..5280cdc73 100644 --- a/storage/metric/interface.go +++ b/storage/metric/interface.go @@ -34,7 +34,7 @@ type MetricPersistence interface { // Get all of the metric fingerprints that are associated with the provided // label set. - GetFingerprintsForLabelSet(model.LabelSet) ([]*model.Fingerprint, error) + GetFingerprintsForLabelSet(model.LabelSet) ([]model.Fingerprint, error) // Get all of the metric fingerprints that are associated for a given label // name. diff --git a/storage/metric/leveldb/leveldb_test.go b/storage/metric/leveldb/leveldb_test.go index 9d4f9310f..38faa056f 100644 --- a/storage/metric/leveldb/leveldb_test.go +++ b/storage/metric/leveldb/leveldb_test.go @@ -887,7 +887,7 @@ func TestGetMetricForFingerprint(t *testing.T) { t.Errorf("Expected one element.") } - v, e := persistence.GetMetricForFingerprint(*result[0]) + v, e := persistence.GetMetricForFingerprint(result[0]) if e != nil { t.Error(e) } @@ -912,7 +912,7 @@ func TestGetMetricForFingerprint(t *testing.T) { t.Errorf("Expected one element.") } - v, e = persistence.GetMetricForFingerprint(*result[0]) + v, e = persistence.GetMetricForFingerprint(result[0]) if e != nil { t.Error(e) diff --git a/storage/metric/leveldb/reading.go b/storage/metric/leveldb/reading.go index a45dfd245..e76851c4d 100644 --- a/storage/metric/leveldb/reading.go +++ b/storage/metric/leveldb/reading.go @@ -180,7 +180,7 @@ func (l *LevelDBMetricPersistence) GetLabelNameFingerprints(n *dto.LabelName) (c return } -func (l *LevelDBMetricPersistence) GetFingerprintsForLabelSet(labelSet model.LabelSet) (fps []*model.Fingerprint, err error) { +func (l *LevelDBMetricPersistence) GetFingerprintsForLabelSet(labelSet model.LabelSet) (fps []model.Fingerprint, err error) { begin := time.Now() defer func() { @@ -222,10 +222,10 @@ func (l *LevelDBMetricPersistence) GetFingerprintsForLabelSet(labelSet model.Lab for i := 1; i < numberOfSets; i++ { base = base.Intersection(sets[i]) } - fps = []*model.Fingerprint{} + fps = []model.Fingerprint{} for _, e := range base.Elements() { fingerprint := e.(model.Fingerprint) - fps = append(fps, &fingerprint) + fps = append(fps, fingerprint) } return