Browse Source

GetFingerprintsForLabelName simplifications.

``MetricPersistence.GetFingerprintsForLabelName(l *model.LabelName)``
->
``MetricPersistence.GetFingerprintsForLabelName(l model.LabelName)``
pull/74/head
Matt T. Proud 12 years ago
parent
commit
1e2d6c7418
  1. 2
      storage/metric/interface.go
  2. 8
      storage/metric/leveldb/leveldb_test.go
  3. 4
      storage/metric/leveldb/reading.go

2
storage/metric/interface.go

@ -38,7 +38,7 @@ type MetricPersistence interface {
// Get all of the metric fingerprints that are associated for a given label // Get all of the metric fingerprints that are associated for a given label
// name. // name.
GetFingerprintsForLabelName(labelName *model.LabelName) ([]*model.Fingerprint, error) GetFingerprintsForLabelName(labelName model.LabelName) ([]*model.Fingerprint, error)
GetMetricForFingerprint(f *model.Fingerprint) (*model.Metric, error) GetMetricForFingerprint(f *model.Fingerprint) (*model.Metric, error)

8
storage/metric/leveldb/leveldb_test.go

@ -791,7 +791,7 @@ func TestGetFingerprintsForLabelName(t *testing.T) {
} }
b := model.LabelName("name") b := model.LabelName("name")
result, getErr := persistence.GetFingerprintsForLabelName(&b) result, getErr := persistence.GetFingerprintsForLabelName(b)
if getErr != nil { if getErr != nil {
t.Error(getErr) t.Error(getErr)
@ -802,7 +802,7 @@ func TestGetFingerprintsForLabelName(t *testing.T) {
} }
b = model.LabelName("request_type") b = model.LabelName("request_type")
result, getErr = persistence.GetFingerprintsForLabelName(&b) result, getErr = persistence.GetFingerprintsForLabelName(b)
if getErr != nil { if getErr != nil {
t.Error(getErr) t.Error(getErr)
@ -813,7 +813,7 @@ func TestGetFingerprintsForLabelName(t *testing.T) {
} }
b = model.LabelName("language") b = model.LabelName("language")
result, getErr = persistence.GetFingerprintsForLabelName(&b) result, getErr = persistence.GetFingerprintsForLabelName(b)
if getErr != nil { if getErr != nil {
t.Error(getErr) t.Error(getErr)
@ -824,7 +824,7 @@ func TestGetFingerprintsForLabelName(t *testing.T) {
} }
b = model.LabelName("sprache") b = model.LabelName("sprache")
result, getErr = persistence.GetFingerprintsForLabelName(&b) result, getErr = persistence.GetFingerprintsForLabelName(b)
if getErr != nil { if getErr != nil {
t.Error(getErr) t.Error(getErr)

4
storage/metric/leveldb/reading.go

@ -231,7 +231,7 @@ func (l *LevelDBMetricPersistence) GetFingerprintsForLabelSet(labelSet model.Lab
return 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() begin := time.Now()
defer func() { defer func() {
@ -242,7 +242,7 @@ func (l *LevelDBMetricPersistence) GetFingerprintsForLabelName(labelName *model.
fps = make([]*model.Fingerprint, 0, 0) 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 { if err != nil {
return return
} }

Loading…
Cancel
Save