Reducers

Juttle reducers operate on batches of points, carrying out a running computation over values contained in the points, optionally over a moving time window.

Reducers can be used as the right-hand side of put expressions, in which case they compute a result over points in the current batch as each new point arrives. They can also be used as the right-hand side of reduce expressions, in which case they compute a result over points in the current batch when the batch ends. For options that govern all reducers, see put and reduce.

Juttle comes with built-in reducers:

avg

Return the average of the values of a specified field.

count

Return the number of points in the stream, optionally filtering on a specified field.

count_unique

Return the total number of unique values of a specified field throughout the batch.

delta

Return the change in value of a field.

first

Return the value of the specified field in the first point that contains it.

last

Return the value of the specified field for the last point that contains it.

mad

Return the Median Absolute Deviation (MAD) of the value of the specified field.

max

Return the maximum value of the specified field from among all points containing that field.

min

Return the minimum value of the specified field from among all points containing that field.

percentile

Return the pth percentile ranked value of the specified field.

pluck

Return an array of the values of a specified field in the batch.

stdev

Return the standard deviation of the value of the specified field.

sum

Return the sum of the values of the specified field throughout the batch.