Window analytics

Standard window functions are provided to perform event based analytics

Objective

Joule provides the ability to perform time or number of events window based analytics. A suite of standard window functions are provided out-of-the-box.

Developers can create custom analytic functions which are deployable as discrete components on the classpath.

Joule provides tumbling and sliding window analytics.

Tumbling windows are a non-overlapping events arrays ordered by time. In a tumbling window, events are grouped in to a single window based on time or count.

An event belongs to only one window. Events within a window are only processed once when a new window is presented for processing.

Tumbling windows

Example & DSL attributes

This code defines a tumbling time window for aggregating data in the processing unit pipeline:

  1. aggregate functions Applies functions like FIRST, LAST, MIN, MAX, SUM, MEAN, VARIANCE, and STDEV on fields like ask, bid, volume, and volatility.

  2. policy The window size is set to 5000 milliseconds (5 seconds).

It processes and emits analytics based on the specified window and functions.

processing unit:
  pipeline:
    - time window:
        emitting type: tumblingQuoteAnalytics
        aggregate functions:
          FIRST: [ask]
          LAST: [ ask ]
          MIN: [ ask ]
          MAX: [ bid ]
          SUM: [ volume ]
          MEAN: [ volatility ]
          VARIANCE: [ volatility ]
          STDEV: [ volatility ]
        policy:
          type: tumblingTime
          window size: 5000

Attribute schema

Attribute
Description
Data Type
Required

emitting type

name of the event

String

preprocessor

Window preprocessor

window listeners

Custom window listeners which are executed on window generation. See window listener documentation below

See documentation below.

aggregate functions

Standard set of aggragation functions based over a window using group by semantics

See documentation below.

policy

Type of window processing. Supported types:

  • Tumbling

    • tumblingTime

    • tumblingCount

  • Sliding

    • slidingTime

    • slidingCount

String

e.g. slidingCount

Available options

In the following pages you can read further how to apply the window functionalities and a list of all the aggregate functions.

Last updated

Was this helpful?