mirror of https://github.com/prometheus/prometheus
Interface simplifications.
GetFingerprintsForLabelName ([]*Fingerprint, error) -> GetFingerprintsForLabelName ([]Fingerprint, error)pull/75/head
parent
e8a733b525
commit
f1245e8dda
|
@ -38,7 +38,7 @@ type MetricPersistence interface {
|
|||
|
||||
// Get all of the metric fingerprints that are associated for a given label
|
||||
// name.
|
||||
GetFingerprintsForLabelName(model.LabelName) ([]*model.Fingerprint, error)
|
||||
GetFingerprintsForLabelName(model.LabelName) ([]model.Fingerprint, error)
|
||||
|
||||
GetMetricForFingerprint(model.Fingerprint) (*model.Metric, error)
|
||||
|
||||
|
|
|
@ -222,7 +222,6 @@ func (l *LevelDBMetricPersistence) GetFingerprintsForLabelSet(labelSet model.Lab
|
|||
for i := 1; i < numberOfSets; i++ {
|
||||
base = base.Intersection(sets[i])
|
||||
}
|
||||
fps = []model.Fingerprint{}
|
||||
for _, e := range base.Elements() {
|
||||
fingerprint := e.(model.Fingerprint)
|
||||
fps = append(fps, fingerprint)
|
||||
|
@ -231,7 +230,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() {
|
||||
|
@ -240,8 +239,6 @@ func (l *LevelDBMetricPersistence) GetFingerprintsForLabelName(labelName model.L
|
|||
recordOutcome(storageOperations, storageLatency, duration, err, map[string]string{operation: getFingerprintsForLabelName, result: success}, map[string]string{operation: getFingerprintsForLabelName, result: failure})
|
||||
}()
|
||||
|
||||
fps = make([]*model.Fingerprint, 0, 0)
|
||||
|
||||
raw, err := l.labelNameToFingerprints.Get(coding.NewProtocolBufferEncoder(model.LabelNameToDTO(&labelName)))
|
||||
if err != nil {
|
||||
return
|
||||
|
@ -256,7 +253,7 @@ func (l *LevelDBMetricPersistence) GetFingerprintsForLabelName(labelName model.L
|
|||
|
||||
for _, m := range unmarshaled.Member {
|
||||
fp := model.Fingerprint(*m.Signature)
|
||||
fps = append(fps, &fp)
|
||||
fps = append(fps, fp)
|
||||
}
|
||||
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue