I want to do the following statistic in WSO2 CEP:
get the count() of all events that arrive in a stream. And I want to do it for the following windows: 5 min, 10 min, 30 min, 60 min. For this I am doing the following code:
from stream#window.time(5 min)
select count() as numEvents
insert into stats;
from stream#window.time(10 min)
select count() as numEvents
insert into stats;
from stream#window.time(30 min)
select count() as numEvents
insert into stats;
from stream#window.time(60 min)
select count() as numEvents
insert into stats;
Is this the correct way of getting this data? This seems like a huge replication of code when the only thing that I want to achieve is to increment the timewindow. Is there any other possibility on doing this in only 1 query? or at least less queries then 4.