promql.linearRegression() 函数
promql.linearRegression() 实现了实现 PromQL 的 deriv() 和 predict_linear() 函数所需的线性回归功能。
重要: internal/promql 包不适用于外部使用。
函数类型签名
(
<-tables: stream[{A with _value: float, _time: time, _stop: time}],
?fromNow: float,
?predict: bool,
) => stream[{B with _value: float}]
有关更多信息,请参见 Function type signatures。
参数
表格
输入数据。默认是管道转发数据 (<-).
预测
输出应包含一个预测。
从现在开始
时间作为浮点值。