0

Using siddhi 4.1.0

Is there any possibility to apply time.windowBatch for upcoming events? I understood the time window is working based on already arrived events.

Say for example,

I am getting multiple results while using window.timeBatch(2 min) with group by clause.

In the given 2 min duration I passed the 50 input events periodically. The expected behavior is all those events put together and given as an single result(used count function to verify). But it gives two results like 40 and 10. Is that first 40 events are fall into the one time window period and second is next window? In this case how I will merge or get all those events are single output for 2 mins?

Also I want to start the time-window once the first event arrived.

I experienced the time-window is running in background, in case the events are coming in middle of first time window it collects the events for 1 min only. The remaining one minute events collected by next time window. So, finally I got 2 batched results.

Please suggest there is any other solution to achieve.

Usecase:

My usecase is based on time duration(time.windowBatch(1 min)) for monitoring switches. I would like to implement following usecase.

Use case: The switch sends the SNMP traps to CEP. The traps are like switchFanFailed and switchFanOk.

If I am receiving switchFanFailed trap the next trap that I am expecting switchFanOk trap will be within the 1 min. Incase the switchFanOk trap is not received within 1 min, then CEP would generate a notification through email. Otherwise It will discard that trap.

Even though my trap generator generate the traps switchFanFailed and switchFanOk within 1 min duration as constant, In some cases I am not able receive the traps in same window.

Say for example, switchFanFailed is coming end of the 0.50 sec, from here I should wait for 1 min to expect switchFanOk trap.

Muthusamy
  • 1
  • 2

2 Answers2

0

Sorry, I am bit confused with your usecase.. :)

Whether your usecase is based on time or length or both.. For time batch window, it starts only after 1st event comes..

If you want to wait until 50 events (or any no of events to arrive) then you have to use lengthBatch window.. If you want process based on time and batch it then use timeBatch window..

Do you have any fixed no of events ? If not, CEP/Siddhi cannot wait/batch indefinitely. There should be something to say end of batch. Isn't ?

Mohanadarshan
  • 830
  • 5
  • 5
  • Thanks for your reply. Added the usecase for your reference. – Muthusamy Jul 18 '16 at 14:40
  • OK, got it.. We have to use pattern for your usecase, not a time batch window.. You can refer sample [1] which is similar to your requirement.. [1] https://docs.wso2.com/display/CEP400/Sample+0111+-+Detecting+non-occurrences+with+Patterns – Mohanadarshan Jul 18 '16 at 16:47
  • Thanks for the tip! I'll check out the pattern. – Muthusamy Jul 20 '16 at 13:31
0

I had a same issue and it always create two summarised for any number of records sent in to my grouping query. The fix for my issue was, one value was differnt from others which was used in the grouping. i suggest you to check the grouping.

if you think of merging two records i suggest you to ues a time batch window timeBatch(1 min) which will summarise the out put of your current data set.

Nu-ONE
  • 679
  • 5
  • 19