Apama Pysys引擎接收改进过程启动

2024-10-04 09:19:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我们正在使用pysys测试apama,并希望提高性能。7到7个频道,我们接收到不同的7个频道。在

问题是启动7次接收需要大约10秒。在

我尝试使用python线程来启动pysysparallel中的receive方法,但是在本例中什么都没有发生。在

有人知道改善这种状况的方法吗?在

多thx


Tags: 方法性能频道线程receive状况本例thx
1条回答
网友
1楼 · 发布于 2024-10-04 09:19:44

我想问题是发动机的启动时间。。。即使您修改CorrelatorHelper类上的receive方法以不阻塞等待输出文件,它仍然需要大约7秒的时间。在

一种可能的方法是在所有7个通道上连接一个引擎接收,将日志记录到一个文件中,但要配置engine_receive以在输出文件中包含通道名称。如果对文件进行验证,原则上至少可以在正则表达式中包含通道名称,例如使用apama5.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

和输入.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

这可能会在某种程度上混淆所有验证,因此可能不是理想的。你应该可以开始在另一个线程,我会有兴趣看到你的代码,如果你想发送?在

相关问题 更多 >