Object -
streams
:
Sum
Aggregator to perform summation of values in a stream.
Methods
Updates the current sum of numeric values based on the eventType. If the eventType is streams:CURRENT,
value is added to the current sum. If the eventType is streams:EXPIRED, value is subtracted from the
current sum. If the eventType is streams:RESET, Current summation will be reset, regardless the value.
Returns a copy of the Sum aggregator without its current state.
Return current state to be saved as a map of any typed values.
Restores the saved state which is passed as a map of any typed values.
Fields
- iSum int 0
-
Holds the sum when the value being aggregated is of type integer.
- fSum float 0.0
-
Holds the sum when the value being aggregated is of type float.
Updates the current sum of numeric values based on the eventType. If the eventType is streams:CURRENT,
value is added to the current sum. If the eventType is streams:EXPIRED, value is subtracted from the
current sum. If the eventType is streams:RESET, Current summation will be reset, regardless the value.
Parameters
- value anydata
-
The numeric value being aggregated to the current sum.
- eventType EventType
-
Type of the incoming event
streams:CURRENT,streams:EXPIREDorstreams:RESET.
-
Return Type
(anydata) aggregated summation after the given
value.
Returns a copy of the Sum aggregator without its current state.
-
Return Type
(Aggregator) Returns
Sumaggregator.
Return current state to be saved as a map of any typed values.
-
Return Type
(map) A map of
anytyped values.