From 1e2d6c7418662b888599bf2f713552a2d8d67f16 Mon Sep 17 00:00:00 2001 From: "Matt T. Proud" Date: Wed, 13 Feb 2013 17:44:35 -0800 Subject: [PATCH] GetFingerprintsForLabelName simplifications. ``MetricPersistence.GetFingerprintsForLabelName(l *model.LabelName)`` -> ``MetricPersistence.GetFingerprintsForLabelName(l model.LabelName)`` --- storage/metric/interface.go | 2 +- storage/metric/leveldb/leveldb_test.go | 8 ++++---- storage/metric/leveldb/reading.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/storage/metric/interface.go b/storage/metric/interface.go index 1664ba7f5..1b57f036a 100644 --- a/storage/metric/interface.go +++ b/storage/metric/interface.go @@ -38,7 +38,7 @@ type MetricPersistence interface { // Get all of the metric fingerprints that are associated for a given label // name. - GetFingerprintsForLabelName(labelName *model.LabelName) ([]*model.Fingerprint, error) + GetFingerprintsForLabelName(labelName model.LabelName) ([]*model.Fingerprint, error) GetMetricForFingerprint(f *model.Fingerprint) (*model.Metric, error) diff --git a/storage/metric/leveldb/leveldb_test.go b/storage/metric/leveldb/leveldb_test.go index a849e0c83..38faa056f 100644 --- a/storage/metric/leveldb/leveldb_test.go +++ b/storage/metric/leveldb/leveldb_test.go @@ -791,7 +791,7 @@ func TestGetFingerprintsForLabelName(t *testing.T) { } b := model.LabelName("name") - result, getErr := persistence.GetFingerprintsForLabelName(&b) + result, getErr := persistence.GetFingerprintsForLabelName(b) if getErr != nil { t.Error(getErr) @@ -802,7 +802,7 @@ func TestGetFingerprintsForLabelName(t *testing.T) { } b = model.LabelName("request_type") - result, getErr = persistence.GetFingerprintsForLabelName(&b) + result, getErr = persistence.GetFingerprintsForLabelName(b) if getErr != nil { t.Error(getErr) @@ -813,7 +813,7 @@ func TestGetFingerprintsForLabelName(t *testing.T) { } b = model.LabelName("language") - result, getErr = persistence.GetFingerprintsForLabelName(&b) + result, getErr = persistence.GetFingerprintsForLabelName(b) if getErr != nil { t.Error(getErr) @@ -824,7 +824,7 @@ func TestGetFingerprintsForLabelName(t *testing.T) { } b = model.LabelName("sprache") - result, getErr = persistence.GetFingerprintsForLabelName(&b) + result, getErr = persistence.GetFingerprintsForLabelName(b) if getErr != nil { t.Error(getErr) diff --git a/storage/metric/leveldb/reading.go b/storage/metric/leveldb/reading.go index 7263a7c6c..bd2022dae 100644 --- a/storage/metric/leveldb/reading.go +++ b/storage/metric/leveldb/reading.go @@ -231,7 +231,7 @@ func (l *LevelDBMetricPersistence) GetFingerprintsForLabelSet(labelSet model.Lab return } -func (l *LevelDBMetricPersistence) GetFingerprintsForLabelName(labelName *model.LabelName) (fps []*model.Fingerprint, err error) { +func (l *LevelDBMetricPersistence) GetFingerprintsForLabelName(labelName model.LabelName) (fps []*model.Fingerprint, err error) { begin := time.Now() defer func() { @@ -242,7 +242,7 @@ func (l *LevelDBMetricPersistence) GetFingerprintsForLabelName(labelName *model. fps = make([]*model.Fingerprint, 0, 0) - raw, err := l.labelNameToFingerprints.Get(coding.NewProtocolBufferEncoder(model.LabelNameToDTO(labelName))) + raw, err := l.labelNameToFingerprints.Get(coding.NewProtocolBufferEncoder(model.LabelNameToDTO(&labelName))) if err != nil { return }