mirror of https://github.com/prometheus/prometheus
Interface simplifications.
GetFingerprintsForLabelSet ([]*Fingerprint, error) -> GetFingerprintsForLabelSet ([]Fingerprint, error)pull/75/head
parent
f03091b139
commit
e8a733b525
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue