mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 00:23:18 +00:00
GetFingerprintsForLabelName simplifications.
``MetricPersistence.GetFingerprintsForLabelName(l *model.LabelName)`` -> ``MetricPersistence.GetFingerprintsForLabelName(l model.LabelName)``
This commit is contained in:
parent
900bb988c1
commit
1e2d6c7418
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user