mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/promrelabel: remove unneded optimizations for labeldrop
and labelkeep
actions
These optimizations may slow down code execution by matching the same label against regexp two times instead of a single time
This commit is contained in:
parent
f9c1fe3852
commit
62d7e07ff7
1 changed files with 0 additions and 22 deletions
|
@ -225,17 +225,6 @@ func (prc *parsedRelabelConfig) apply(labels []prompbmarshal.Label, labelsOffset
|
|||
}
|
||||
return labels
|
||||
case "labeldrop":
|
||||
keepSrc := true
|
||||
for i := range src {
|
||||
label := &src[i]
|
||||
if prc.matchString(label.Name) {
|
||||
keepSrc = false
|
||||
break
|
||||
}
|
||||
}
|
||||
if keepSrc {
|
||||
return labels
|
||||
}
|
||||
dst := labels[:labelsOffset]
|
||||
for i := range src {
|
||||
label := &src[i]
|
||||
|
@ -245,17 +234,6 @@ func (prc *parsedRelabelConfig) apply(labels []prompbmarshal.Label, labelsOffset
|
|||
}
|
||||
return dst
|
||||
case "labelkeep":
|
||||
keepSrc := true
|
||||
for i := range src {
|
||||
label := &src[i]
|
||||
if !prc.matchString(label.Name) {
|
||||
keepSrc = false
|
||||
break
|
||||
}
|
||||
}
|
||||
if keepSrc {
|
||||
return labels
|
||||
}
|
||||
dst := labels[:labelsOffset]
|
||||
for i := range src {
|
||||
label := &src[i]
|
||||
|
|
Loading…
Reference in a new issue