Analytic functions
Analytic functions perform complex calculation over a window of grouped events
Last updated
Was this helpful?
Analytic functions perform complex calculation over a window of grouped events
Last updated
Was this helpful?
Analytic functions are used when calculations over an event window is required. These functions are executed on each window generation trigger, windows are generated when the window policy is satisfied.
Joule is shipped with a starter pack of stateful and stateless functions to support initial use cases. The platform can be extended using the to build custom functions.
This code defines a sliding time window for calculating and emitting additional attributes. On emit
of data, EMA
is appended on the property name automatically.
window functions
ema rates
Calculates the exponential moving average (EMA) for ask
and bid
with a smoothing factor of 0.001996007984032.
ranges
Calculates the min-max range for ask
and bid
.
norms
Computes the Z-score for ask
and bid
.
policy
slidingTime The window slides every 500 milliseconds.
window size The window covers 2500 milliseconds (2.5 seconds).
This configuration calculates attributes like ask_EMA
, bid_EMA
, ask_MINMAX_NORM
, bid_MINMAX_NORM
, ask_ZSCORE
, and bid_ZSCORE
over a sliding time window.
Stateful analytics
Stateless based analytics over a grouped set of events
Stateless analytics
Stateful based analytics over a grouped set of events