Excerpt | ||
---|---|---|
| ||
Siddhi Inbuilt windows in wiki format |
...
timeBatch
Anchor | ||||
---|---|---|---|---|
|
Syntax | <event> timeBatch(<int|long|time> windowTime) |
---|---|
Extension Type | Window |
Description | A batch (tumbling) time window that holds events that arrive during windowTime periods, and gets updated for each windowTime . |
Parameter | windowTime : The batch time period for which the window should hold events. |
Return Type | Returns current and expired events. |
Examples |
|
length
Anchor | ||||
---|---|---|---|---|
|
Syntax | <event> length(<int> windowLength) |
---|---|
Extension Type | Window |
Description | A sliding length window that holds the last windowLength events at a given time, and gets updated for each arrival and expiry. |
Parameter |
|
Return Type | Returns current and expired events. |
Examples |
|
...
firstUnique
Anchor | ||||
---|---|---|---|---|
|
Syntax | <event> firstUnique(<string> attribute) |
---|---|
Extension Type | Window |
Description | First unique window processor keeps only the first events that are unique according to the given unique attribute. |
Parameter | attribute : The attribute that should be checked for uniqueness. |
Return Type | Returns current and expired events. |
Examples | firstUnique(ip) returns the first event arriving for each unique ip . |
...
Syntax |
|
---|---|
Extension Type | Window |
Description | This window holds a batch of events that equal the number specified as the windowLength and sorts them in the given order. |
Parameter |
|
Return Type | Returns current and expired events. |
Examples | sort(5, volumeprice, 'asc', price, 'desc') returns keeps the events sorted by price in the ascending order of volume, and descending order of price for a window of 5 events. Therefore, at any given time, the window contains the 5 lowest prices. |
frequent
Anchor | ||||
---|---|---|---|---|
|
...
timeLength
Syntax | |
---|---|
Extension Type | Window |
Description | A sliding time window that, at a given time holds the last windowLength events that arrived during last windowTime period, and gets updated for every event arrival and expiry. |
Parameters |
|
Return Type | Returns current and expired events. |
Examples |
|
...