Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This sample demonstrates how to set up an execution plan to perform calculations over time by aggregating events. The queries here use time windows , and time batch windows to aggregate event over time. This sample uses uses the Event simulatorSimulator for inputs and the logger publisher for logging the outputs custom output events to the CEP consoleCustom events are events with custom mappings that does not adhere to the default event formats. For more information on event formats, see Event Formats. 

The queries used in the WindowBasedAvgTemp execution plan used in this sample is are as follows:

Code Block
-- with time sliding window of 1 mim
from TempStream#window.time(1 min)
select roomNo, avg(temp) as avgTemp
group by roomNo
insert all events into AvgRoomTempStream ;

-- with time batch (tumbling) window of 1 min
from TempStream#window.timeBatch(1 min)
select roomNo, avg(temp) as avgTemp
group by roomNo
insert all events into AvgRoomTempPerMinStream ;

...