|
@@ -1,6 +1,6 @@
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
<!--
|
|
- ~ Copyright 2022 EMQ Technologies Co., Ltd.
|
|
|
|
|
|
+ ~ Copyright 2023 EMQ Technologies Co., Ltd.
|
|
~
|
|
~
|
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
|
~ you may not use this file except in compliance with the License.
|
|
~ you may not use this file except in compliance with the License.
|
|
@@ -133,44 +133,51 @@
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
<stringProp name="Argument.value">{
|
|
<stringProp name="Argument.value">{
|
|
- "id": "rule1",
|
|
|
|
- "name": "Group order规则",
|
|
|
|
- "graph": {
|
|
|
|
- "nodes": {
|
|
|
|
- "device1": {
|
|
|
|
- "type": "source",
|
|
|
|
- "nodeType": "mqtt",
|
|
|
|
- "props": {
|
|
|
|
- "datasource": "devices/1/messages",
|
|
|
|
- "timestamp": "ts"
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "device2": {
|
|
|
|
- "type": "source",
|
|
|
|
- "nodeType": "mqtt",
|
|
|
|
- "props": {
|
|
|
|
- "datasource": "devices/2/messages",
|
|
|
|
- "timestamp": "ts"
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "window": {
|
|
|
|
- "type": "operator",
|
|
|
|
- "nodeType": "window",
|
|
|
|
- "props": {
|
|
|
|
- "type": "hoppingwindow",
|
|
|
|
- "unit": "ms",
|
|
|
|
- "size": 1500,
|
|
|
|
- "interval": 300
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "groupop": {
|
|
|
|
- "type": "operator",
|
|
|
|
- "nodeType": "groupby",
|
|
|
|
- "props": {
|
|
|
|
- "dimensions": ["device_id"]
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "countop": {
|
|
|
|
|
|
+ "id": "rule1",
|
|
|
|
+ "name": "Group order规则",
|
|
|
|
+ "graph": {
|
|
|
|
+ "nodes": {
|
|
|
|
+ "device1": {
|
|
|
|
+ "type": "source",
|
|
|
|
+ "nodeType": "mqtt",
|
|
|
|
+ "props": {
|
|
|
|
+ "datasource": "devices/1/messages",
|
|
|
|
+ "timestamp": "ts"
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "device2": {
|
|
|
|
+ "type": "source",
|
|
|
|
+ "nodeType": "mqtt",
|
|
|
|
+ "props": {
|
|
|
|
+ "datasource": "devices/2/messages",
|
|
|
|
+ "timestamp": "ts"
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "watermark": {
|
|
|
|
+ "type": "operator",
|
|
|
|
+ "nodeType": "watermark",
|
|
|
|
+ "props": {
|
|
|
|
+ "emitters":["device1","device2"]
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "window": {
|
|
|
|
+ "type": "operator",
|
|
|
|
+ "nodeType": "window",
|
|
|
|
+ "props": {
|
|
|
|
+ "type": "hoppingwindow",
|
|
|
|
+ "unit": "ms",
|
|
|
|
+ "size": 1500,
|
|
|
|
+ "interval": 300
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "groupop": {
|
|
|
|
+ "type": "operator",
|
|
|
|
+ "nodeType": "groupby",
|
|
|
|
+ "props": {
|
|
|
|
+ "dimensions": ["device_id"]
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "countop": {
|
|
"type": "operator",
|
|
"type": "operator",
|
|
"nodeType": "aggfunc",
|
|
"nodeType": "aggfunc",
|
|
"props": {
|
|
"props": {
|
|
@@ -198,42 +205,43 @@
|
|
"type": "operator",
|
|
"type": "operator",
|
|
"nodeType": "pick",
|
|
"nodeType": "pick",
|
|
"props": {
|
|
"props": {
|
|
- "fields": ["device_id", "count"]
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "mqtt": {
|
|
|
|
- "type": "sink",
|
|
|
|
- "nodeType": "mqtt",
|
|
|
|
- "props": {
|
|
|
|
- "server": "tcp://${mqtt_srv}:1883",
|
|
|
|
- "topic": "devices/result"
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "log": {
|
|
|
|
- "type": "sink",
|
|
|
|
- "nodeType": "log",
|
|
|
|
- "props": {}
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "topo": {
|
|
|
|
- "sources": ["device1", "device2"],
|
|
|
|
- "edges": {
|
|
|
|
- "device1": ["window"],
|
|
|
|
- "device2": ["window"],
|
|
|
|
- "window": ["groupop"],
|
|
|
|
- "groupop": ["countop"],
|
|
|
|
- "countop": ["filterop"],
|
|
|
|
- "filterop": ["orderop"],
|
|
|
|
- "orderop": ["pick"],
|
|
|
|
- "pick": ["mqtt", "log"]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "options": {
|
|
|
|
- "isEventTime": true,
|
|
|
|
- "lateTolerance" : 0
|
|
|
|
- }
|
|
|
|
-}</stringProp>
|
|
|
|
|
|
+ "fields": ["device_id", "count"]
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "mqtt": {
|
|
|
|
+ "type": "sink",
|
|
|
|
+ "nodeType": "mqtt",
|
|
|
|
+ "props": {
|
|
|
|
+ "server": "tcp://${mqtt_srv}:1883",
|
|
|
|
+ "topic": "devices/result"
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "log": {
|
|
|
|
+ "type": "sink",
|
|
|
|
+ "nodeType": "log",
|
|
|
|
+ "props": {}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "topo": {
|
|
|
|
+ "sources": ["device1", "device2"],
|
|
|
|
+ "edges": {
|
|
|
|
+ "device1": ["watermark"],
|
|
|
|
+ "device2": ["watermark"],
|
|
|
|
+ "watermark":["window"],
|
|
|
|
+ "window": ["groupop"],
|
|
|
|
+ "groupop": ["countop"],
|
|
|
|
+ "countop": ["filterop"],
|
|
|
|
+ "filterop": ["orderop"],
|
|
|
|
+ "orderop": ["pick"],
|
|
|
|
+ "pick": ["mqtt", "log"]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "options": {
|
|
|
|
+ "isEventTime": true,
|
|
|
|
+ "lateTolerance" : 0
|
|
|
|
+ }
|
|
|
|
+ }</stringProp>
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
</elementProp>
|
|
</elementProp>
|
|
</collectionProp>
|
|
</collectionProp>
|
|
@@ -342,7 +350,7 @@
|
|
<hashTree>
|
|
<hashTree>
|
|
<JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
|
|
<JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
|
|
<stringProp name="JSON_PATH">$.op_window_0_records_in_total</stringProp>
|
|
<stringProp name="JSON_PATH">$.op_window_0_records_in_total</stringProp>
|
|
- <stringProp name="EXPECTED_VALUE">15</stringProp>
|
|
|
|
|
|
+ <stringProp name="EXPECTED_VALUE">13</stringProp>
|
|
<boolProp name="JSONVALIDATION">true</boolProp>
|
|
<boolProp name="JSONVALIDATION">true</boolProp>
|
|
<boolProp name="EXPECT_NULL">false</boolProp>
|
|
<boolProp name="EXPECT_NULL">false</boolProp>
|
|
<boolProp name="INVERT">false</boolProp>
|
|
<boolProp name="INVERT">false</boolProp>
|