liveBook · Manning

Value average pattern

As explained in Event Processing in Action

A threshold pattern that tests the arithmetic mean of a specified numeric attribute across participant events.

A value average pattern tests whether the arithmetic mean of a numeric attribute across participant events satisfies a threshold assertion. It is a threshold pattern; unlike value max and value min, its result cannot be determined until all participant events are assembled. Events without the attribute are excluded from the computation. section 9.2.2

Trading amounts

For the amount attribute, a threshold of > $5M is satisfied when the average amount across the participant events is $6.8M. section 9.2.2

How Event Processing in Action covers it

How deep it goes
Defines the mean calculation, supported comparisons, and missing-attribute exclusion; defers a final result until all participant events are assembled.
Examples
Uses trading amounts averaging $6.8M to satisfy a > $5M threshold.
What it assumes
Requires participant events, a numeric attribute, and a threshold assertion.
What you can do after
Evaluate whether a completed set of participant events satisfies an average-value threshold.
How it connects
Connects value max and value min as threshold patterns, and identifies the functor pattern as a more general form.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Event Processing in Action. The section links point to the parts of the book it draws on.