首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Apama Pysys引擎收到改进的进程启动

Apama Pysys引擎收到改进的进程启动
EN

Stack Overflow用户
提问于 2015-10-10 01:10:54
回答 1查看 155关注 0票数 1

我们正在使用pysys测试apama,并希望提高性能。阻碍我们的一件事是,我们发出7个engine_receive命令,将7个不同的通道监控到7个不同的文件中。

问题是启动这个7接收大约需要10秒。

我尝试使用python线程以pysys并行方式开始调用接收方法,但在本例中什么也没有发生。

有没有人知道改进这一点的方法?

多个thx

EN

回答 1

Stack Overflow用户

发布于 2015-10-13 22:32:47

我认为这里的问题是engine_receive的启动时间...即使您修改了CorrelatorHelper类上的接收方法以不阻止等待输出文件,它仍然需要大约7秒的时间。

一种可能的方法是在所有7个通道上连接一个engine_receive,并将其记录到一个文件中,但将engine_receive配置为在输出文件中包含通道名称。原则上,您至少可以在您的regex中包含频道名称,如果在文件上进行验证,例如使用Apama 5.3

代码语言:javascript
复制
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

所述input.mon文件具有;

代码语言:javascript
复制
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";
        }
    }
}

将在receive.log中拥有;

代码语言:javascript
复制
"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

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33043765

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档