Timed Buffer

The Timed Buffer stage is used to accumulate events for a max period of Y, and then emit all the events as an array. This is helpful in examples where you’re sampling source data at a high frequency, but the target system wants to process the data in time chunks (ex. 1 minute chunks).

Stage Timed Buffer

Window Interval

Amount of time event data is accumulated before emitting.

Window Expression

The Window Expression splits incoming events into separate buffers based on a key, so events that produce the same key are grouped together. By default the Window Expression is empty, which places every event in a single buffer (calling stage.setBufferKey(null) has the same effect). Each keyed buffer has its own Window Interval and emits independently.

The expression is JavaScript that runs once for each incoming event and calls stage.setBufferKey(key). For example, the expression below emits a separate array of events for each source every Window Interval.

stage.setBufferKey(event.name)

See Size Buffer for more examples and tips on choosing a key.