getCEPEngineStat
Syntax
getCEPEngineStat(engine)
Details
Check the status of a specific CEP engine.
Parameters
engine is the engine object returned by createCEPEngine.
Returns
It returns a dictionary containing the following keys:
-
EngineStat: a dictionary with the info of engine status (same as the returned info as
getStreamEngineStat().CEPEngine). -
eventSchema: a table with the info of all events received.
| Column Name | Description |
|---|---|
| eventType | the event type |
| eventField | the field names (separated by comma) of the event type |
| fieldType | data types (separated by comma) of eventField |
| fieldTypeId | data type IDs of eventField |
| fieldFormId | data form IDs of eventField (0: scalar; 1: vector; 2: pair; 3: matrix; 4: set; 5: dictionary; 6: table). Currently, only 0 and 1 will be returned. |
-
subEngineStat: a table with the info of sub-engine status.
| Column Name | Description |
|---|---|
| subEngineName | the name of the sub-engine |
| eventsOnInputQueue | the number of events in the input queue |
| monitorNumber | the number of monitors |
| listeners | the number of listeners |
| timers | the number of timers. When using
addEventListener with any of the following
parameters specified: at, wait, within, or
exceedTime, a timer will be created. |
| eventsRouted | the number of events routed to the front of the input queue |
| eventsSent | the number of events sent to the end of the input queue |
| eventsReceived | the number of receivedevents |
| eventsConsumed | the number of matched events |
| lastEventTime | the timestamp of the last event |
| lastErrorMessage | the last error message |
| lastErrorTimestamp | the timestamp of the last error message |
-
dataViewEngines: a table with the info of data view engines' status.
| Column Name | Description |
|---|---|
| name | the name of the data view engine |
| user | the name of the user who creates the engine |
| status | data view engine status |
| lastErrorMessage | the last error message |
| lastErrorTimestamp | the timestamp of the last error message |
| keyColumns | key column(s) (separated by space) specified by parameter keyColumns. |
| outputTableName | the output table name |
| useSystemTime | whether useSystemTime is set to true |
| throttle | the time interval between data writes to the outputTable. If throttle parameter is not specified, returns NULL. |
| numItems | the row count |
| memoryUsed | the memory (in bytes) occupied by data view engine |
Examples
class Orders{
eventTime :: TIMESTAMP
sym :: STRING
val0 :: INT
val1 :: FLOAT
val2 :: DOUBLE
def Orders(s,v0,v1,v2){
sym = s
val0 = v0
val1 = v1
val2 = v2
eventTime = now()
}
}
class mainMonitor:CEPMonitor {
ordersTable :: ANY
def mainMonitor(){
ordersTable = array(ANY, 0)
}
def updateOrders(event) {
ordersTable.append!([event.sym, event.val0, event.val1, event.val2])
}
def onload(){
addEventListener(updateOrders, 'Orders',,'all')
}
}
dummy = table(array(TIMESTAMP, 0) as eventTime,array(STRING, 0) as eventType, array(BLOB, 0) as blobs)
engine=createCEPEngine(name="cep_engine",monitors=<mainMonitor()>,dummyTable=dummy,eventSchema=Orders,timeColumn='eventTime')
appendEvent(`cep_engine,Orders("a000", 3, 3.0, 30.0))
getCEPEngineStat(`cep_engine)
Related functions: createCEPEngine, dropStreamEngine
