getCEPEngineMonitor

Syntax

getCEPEngineMonitor(engine, subEngineName, [monitorName])

Details

Get a specified or all initial (non-spawned) monitor instances from the specified CEP engine for inspecting their member variables.

Parameters

engine is an engine object or name.

subEngineName is a STRING scalar indicating the name of the CEP sub-engine.

monitorName (optional) is a STRING scalar indicating the monitor name. If not specified, returns all initial monitors.

Returns

A monitor instance, or a dictionary where the key is the monitor name and the value is the monitor instance.

Examples

class mainMonitor:CEPMonitor{      
    ordersTable :: ANY  
    def mainMonitor(){
        ordersTable = array(ANY, 0)  
    }
    
    def updateOrders(event) {
        ordersTable.append!([event.trader, event.market, event.code, event.price, event.qty])
    }
   
    def onload(){
        addEventListener(updateOrders, 'Orders',,'all') 
    }
}

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()
    }
}

dummy = table(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs)
try{dropStreamEngine("cep1")}catch(ex){}
engine=createCEPEngine("cep1",<mainMonitor()>,dummy,Orders,,'eventTime',,,"sym")

appendEvent(`cep1,Orders("a000", 3, 3.0, 30.0))

getCEPEngineStat('cep1').subEngineStat["subEngineName"]

monitors = getCEPEngineMonitor('cep1', 'a000', 'mainMonitor')