Interface simplifications.

GetFingerprintsForLabelSet ([]*Fingerprint, error) ->
GetFingerprintsForLabelSet ([]Fingerprint, error)
pull/75/head
Matt T. Proud 2013-02-14 08:07:59 -08:00
parent f03091b139
commit e8a733b525
4 changed files with 7 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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