Apama Pysys engine receive improve process start up

172 views Asked by At

We are using pysys to test apama and want to improve performance. One thing which holds us back is that we issue 7 engine_receive to monitor 7 different channels into 7 different file.

The problem is that starting up this 7 receive takes ~10 seconds.

I try to use python threading to start invoke the receive method in pysys parallel, but in this case nothing happens.

Does someone knows a way to improve this?

Many thx

1

There are 1 answers

0
moraygrieve On

I think the problem here is the start up time of engine_receive ... even if you modify the receive method on the CorrelatorHelper class to not block waiting for the output file, it still takes around 7 seconds.

One potential approach is to connect one engine_receive on all 7 channels, logging to one file, but to configure engine_receive to include the channel name in the output file. You could in principle at least then include the channel name in your regex's if validating on the file, e.g. using Apama 5.3

from pysys.constants import *
from pysys.basetest import BaseTest
from apama.common import XArgsHolder
from apama.correlator import CorrelatorHelper

    class PySysTest(BaseTest):
        def execute(self):
            correlator = CorrelatorHelper(self)
            correlator.start(logfile='correlator.log')
            correlator.receive('receive.log', channels=['channel1','channel2','channel3'], arguments=['-C'])
            correlator.injectMonitorscript('input.mon')
            self.wait(4.0)

        def validate(self):
            pass

with the input.mon file having;

monitor InputSender {

    action onload {
        on all wait(1.0) {
            emit "Sending to channel 1" to "channel1";
            emit "Sending to channel 2" to "channel2";
            emit "Sending to channel 3" to "channel3";
        }
    }
}

will have in the receive.log;

"channel1",Sending to channel 1
"channel2",Sending to channel 2
"channel3",Sending to channel 3
"channel1",Sending to channel 1
"channel2",Sending to channel 2
"channel3",Sending to channel 3
"channel1",Sending to channel 1
"channel2",Sending to channel 2
"channel3",Sending to channel 3
"channel1",Sending to channel 1
"channel2",Sending to channel 2
"channel3",Sending to channel 3

This might confuse all validation to some extent, so might not be ideal. You should be able to start in another thread, and I would be interested to see your code if you want to send on?