mirror of
https://github.com/prometheus/prometheus
synced 2024-12-27 00:53:12 +00:00
Implement unary negation for native histograms
Signed-off-by: Charles Korn <charles.korn@grafana.com>
This commit is contained in:
parent
113de6301c
commit
9852855084
@ -1799,6 +1799,9 @@ func (ev *evaluator) eval(expr parser.Expr) (parser.Value, annotations.Annotatio
|
||||
for j := range mat[i].Floats {
|
||||
mat[i].Floats[j].F = -mat[i].Floats[j].F
|
||||
}
|
||||
for j := range mat[i].Histograms {
|
||||
mat[i].Histograms[j].H = mat[i].Histograms[j].H.Copy().Mul(-1)
|
||||
}
|
||||
}
|
||||
if !ev.enableDelayedNameRemoval && mat.ContainsSameLabelset() {
|
||||
ev.errorf("vector cannot contain metrics with the same labelset")
|
||||
|
Loading…
Reference in New Issue
Block a user