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.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---