What query language hasn't left you wanting of just a few more functions? The Juttle dataflow language comes with powerful built-in functions like percentile() but you can define your own functions or reducers that operate on every point in a stream or on batches of points. You can also import functions that other people have written.
In this example, we implement an exponentially weighted moving average calculation and import a rate of change calculation.
- Try changing the weight used in the ewma function by changing .1 to .9 on line 16.
- On line 7, we've imported a derivative reducer. Let's plot what it does by uncommenting line 20.
- Or instead plot it on the same graph by adding "der" to the list of columns in line 19.