mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Remove atan2()
Signed-off-by: Levi Harrison <git@leviharrison.dev>
This commit is contained in:
parent
f1d94cc5f6
commit
9fc7ba33aa
|
@ -600,19 +600,6 @@ func funcAtan(vals []parser.Value, args parser.Expressions, enh *EvalNodeHelper)
|
||||||
return simpleFunc(vals, enh, math.Atan)
|
return simpleFunc(vals, enh, math.Atan)
|
||||||
}
|
}
|
||||||
|
|
||||||
// === atan2(Vector1, Vector2 parser.ValueTypeVector) Vector ===
|
|
||||||
func funcAtan2(vals []parser.Value, args parser.Expressions, enh *EvalNodeHelper) Vector {
|
|
||||||
y := vals[0].(Vector)
|
|
||||||
x := vals[1].(Vector)
|
|
||||||
|
|
||||||
for i := 0; i < len(y); i++ {
|
|
||||||
enh.Out = append(enh.Out, Sample{
|
|
||||||
Point: Point{V: math.Atan2(y[i].V, x[i].V)},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return enh.Out
|
|
||||||
}
|
|
||||||
|
|
||||||
// === rad(Vector parser.ValueTypeVector) Vector ===
|
// === rad(Vector parser.ValueTypeVector) Vector ===
|
||||||
func funcRad(vals []parser.Value, args parser.Expressions, enh *EvalNodeHelper) Vector {
|
func funcRad(vals []parser.Value, args parser.Expressions, enh *EvalNodeHelper) Vector {
|
||||||
return simpleFunc(vals, enh, func(v float64) float64 {
|
return simpleFunc(vals, enh, func(v float64) float64 {
|
||||||
|
@ -1002,7 +989,6 @@ var FunctionCalls = map[string]FunctionCall{
|
||||||
"acos": funcAcos,
|
"acos": funcAcos,
|
||||||
"asin": funcAsin,
|
"asin": funcAsin,
|
||||||
"atan": funcAtan,
|
"atan": funcAtan,
|
||||||
"atan2": funcAtan2,
|
|
||||||
"avg_over_time": funcAvgOverTime,
|
"avg_over_time": funcAvgOverTime,
|
||||||
"ceil": funcCeil,
|
"ceil": funcCeil,
|
||||||
"changes": funcChanges,
|
"changes": funcChanges,
|
||||||
|
|
|
@ -54,11 +54,6 @@ var Functions = map[string]*Function{
|
||||||
ArgTypes: []ValueType{ValueTypeVector},
|
ArgTypes: []ValueType{ValueTypeVector},
|
||||||
ReturnType: ValueTypeVector,
|
ReturnType: ValueTypeVector,
|
||||||
},
|
},
|
||||||
"atan2": {
|
|
||||||
Name: "atan2",
|
|
||||||
ArgTypes: []ValueType{ValueTypeVector, ValueTypeVector},
|
|
||||||
ReturnType: ValueTypeVector,
|
|
||||||
},
|
|
||||||
"avg_over_time": {
|
"avg_over_time": {
|
||||||
Name: "avg_over_time",
|
Name: "avg_over_time",
|
||||||
ArgTypes: []ValueType{ValueTypeMatrix},
|
ArgTypes: []ValueType{ValueTypeMatrix},
|
||||||
|
|
Loading…
Reference in a new issue