我使用 Siddhi CEP 3.0.2 作为独立库。我有一个带有以下流和查询定义的执行计划,以关联连续事件并检测更改。我正在调用自定义函数调用。流定义中提到的对象属性是自定义 java 对象和 java.util.Map 对象类型。
在每个事件定期发生 5 分钟后,我可以看到 CPU 利用率在一秒钟内达到 40% 到 50% 左右,然后逐渐下降。但是这个 CPU 利用率每 5 分钟就会增加一次。
我使用模式查询的方式有问题。对此有什么帮助吗?
define stream portStream (source string,seq long, portInfo object);
define stream deviceStream (source string,seq long, deviceinfo object);
partition with (source of portstream, source of deviceStream) begin " +
@info(name = 'query1')
from (every e1= portStream->e2=portStream[e1.seq != e2.seq]) within 6 min "+
select e2.seq as currSeq, e1.source,
custom:findPortStatus(e1.portInfo, e2.portInfo) as affecteddata "
insert into portStatusStream;
@info(name = 'query2’)
from (every e1=deviceStream-> e2=deviceStream [seq!=e1.seq]) within 6 min
select e2.seq as curSeq, custom:findDeviceStatus(e1.deviceinfo,e2.deviceinfo)
as affectedDeviceInfo
insert into dStatusChangedStream; "
end;