User defined analytics
This example computes the exponential moving average using a Joule OOTB function packaged as a jar using the Joule SDK.
Use case configuration
File: app-ema-analytics-and-influx.env
SOURCEFILE=conf/sources/stockQuoteStream.yaml
ENGINEFILE=conf/usecases/slidingEventWindowEMAAnalytics.yaml
PUBLISHFILE=conf/publishers/influxdbStandardAnalytics.yamlPipeline configuration
This pipeline will compute a sliding window function on a single event type based on the symbol CVCO
processing unit:
pipeline:
- filter:
expression: "symbol == 'CVCO'"
- sliding window analytics:
function: com.fractalworks.streams.processors.analytics.functions.ExponentialMovingAverage
window size: 5
fields: [ ask, bid ]
parameters:
emaFactor: 0.33333Function Implementation
This function is interesting as it uses the previous ema value to compute the next value, Joule manages this process on behalf of the developer.
Last updated