timeWeightedAvg() 函数
timeWeightedAvg()
为每个输入表返回 _value
列中非空值的时间加权平均值,结果为浮点数。
时间加权使用表中值的线性插值积分计算。
函数类型签名
(<-tables: stream[A], unit: duration) => stream[{B with _value: float, _value: float, _stop: D, _start: C}] where A: Record
有关更多信息,请参阅函数类型签名。
参数
unit
(必需) 用于计算时间加权平均值的时间单位。
tables
输入数据。默认为管道转发数据 (<-
)。
示例
计算值的时间加权平均值
data
|> timeWeightedAvg(unit: 1s)
此页内容是否对您有帮助?
感谢您的反馈!