[
https://issues.apache.org/jira/browse/EAGLE-818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15718243#comment-15718243
]
ASF GitHub Bot commented on EAGLE-818:
--------------------------------------
Github user haoch commented on a diff in the pull request:
https://github.com/apache/incubator-eagle/pull/709#discussion_r90759126
--- Diff:
eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/stream/CEPFunctionTest.java
---
@@ -29,22 +30,31 @@
public void testSiddhiFunction() {
CEPFunction function = new CEPFunction(
"define stream inputStream (name string, value double);\n "
- + "from inputStream#window.timeBatch( 1 min ) \n" +
+ + "from inputStream#window.timeBatch( 10 sec ) \n" +
"select name, avg(value) as avgValue\n" +
"group by name \n" +
"insert into outputStream ",
"inputStream","outputStream");
Collector collector = new Collector() {
@Override
public void collect(Object key, Map event) {
-
+
Assert.assertTrue(Double.valueOf(event.get("avgValue").toString()) == 0.97);
}
};
function.open(collector);
function.transform(new HashMap<String,Object>() {{
put("name","cpu.usage");
put("value", 0.98);
}});
+ function.transform(new HashMap<String,Object>() {{
+ put("name","cpu.usage");
+ put("value", 0.96);
+ }});
+ try {
+ Thread.sleep(60000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
--- End diff --
NEVER use `e.printStackTrace();` ANY WHERE.
> CEP Based Aggregate Framework
> -----------------------------
>
> Key: EAGLE-818
> URL: https://issues.apache.org/jira/browse/EAGLE-818
> Project: Eagle
> Issue Type: Improvement
> Affects Versions: v0.5.0
> Reporter: Zhao, Qingwen
> Assignee: Zhao, Qingwen
> Fix For: v0.5.0
>
>
> Implementation of CEP based aggregate framework
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)