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
和输入.mon文件具有
^{pr2}$
将在接收.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
我想问题是发动机的启动时间。。。即使您修改CorrelatorHelper类上的receive方法以不阻塞等待输出文件,它仍然需要大约7秒的时间。在
一种可能的方法是在所有7个通道上连接一个引擎接收,将日志记录到一个文件中,但要配置engine_receive以在输出文件中包含通道名称。如果对文件进行验证,原则上至少可以在正则表达式中包含通道名称,例如使用apama5.3
和输入.mon文件具有
^{pr2}$将在接收.log
这可能会在某种程度上混淆所有验证,因此可能不是理想的。你应该可以开始在另一个线程,我会有兴趣看到你的代码,如果你想发送?在
相关问题 更多 >
编程相关推荐