InfluxDB flux 自己寫移動累加function
InfluxDB flux 自己寫移動累加function 例如:我要得知 6小時交易量 / 6小時累積雨量 等等 如何Query 不幸的 flux 內建只有移動平均 movingAverage() function timedMovingAverage() function 可以使用 那就自己寫一個 這時候就自己寫一個function 直接看語法: timedMovingSum = ( every , period , column = "_value" , tables = < - ) => tables | > window ( every : every , period : period ) | > sum ( column : column ) | > duplicate ( column : "_stop" , as : "_time" ) | > window ( every : inf ) usage from ( bucket : "quote" ) | > range ( start : v . timeRangeStart , stop : v . timeRangeStop ) | > filter ( fn : ( r ) => r . _measurement == "realtime" and r . symbol == "${symbolSel}" and r . _field == "${col}" ) | > difference ( ) | > difference ( ) | > timedMovingSum ( every : 5 m , period : 1 h ) | > movingAverage ( n : int ( v : strings . replaceAll ( v : ...