-
Notifications
You must be signed in to change notification settings - Fork 5
/
conf.json
146 lines (146 loc) · 3.24 KB
/
conf.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{
"io": [
{
"type": "webserver",
"topicPrefix": "ws/",
"port": 3000
},
{
"type": "mqtt",
"topicPrefix": "",
"url": "mqtt://localhost:1883"
},
{
"type": "hookCall",
"url": "http://localhost:3000/hook",
"topicPrefix": "hook/",
"responseTopic": "computed/hooks/response1"
}
],
"transforms": [
{
"fromTopic": "ws/test1",
"toTopic": "computed/test1",
"emitInterval": 30,
"emitType": "repeat",
"template": {
"message": "${stringParam}"
}
},
{
"fromTopic": "computed/test1",
"toTopic": "hook/test2",
"emitInterval": 60,
"emitType": "once",
"template": {
"message": "${message}"
}
},
{
"fromTopic": "computed/hooks/response1",
"toTopic": "computed/map",
"emitType": "map",
"useMetrics": {
"lT": "lastMessageTime",
"fT": "firstMessageTime",
"pT": "prevMessageTime",
"mC": "messageCount"
},
"template": {
"responseStatus": {
"$eval": "responseStatus"
},
"avgMsgPerSec": {
"$eval": "floor((lT-fT)/mC/1000)"
},
"msgDelay": {
"$eval": "floor((lT-pT)/1000)"
}
}
},
{
"fromTopic": "computed/hooks/response1",
"toTopic": "computed/filter/ok",
"emitType": "filter",
"filterTemplate": {
"$if": "responseStatus == 200",
"then": true,
"else": false
}
},
{
"fromTopic": "computed/hooks/response1",
"toTopic": "computed/filter/nok",
"emitType": "filter",
"filterTemplate": {
"$if": "responseStatus != 200",
"then": true,
"else": false
}
},
{
"fromTopic": "computed/hooks/response1",
"toTopic": "computed/collect/ok",
"emitType": "collect",
"filterTemplate": {
"$if": "responseStatus == 200",
"then": true,
"else": false
},
"template": {
"request": "${requestBody}"
}
},
{
"fromTopics": [
"ws/test1",
"ws/test2"
],
"toTopic": "computed/zip",
"emitType": "zipLast",
"template": {
"firstNum": "${messages[0].numParam}",
"secondNum": "${messages[1].numParam}",
"sum": {
"$eval": "messages[0].numParam + messages[1].numParam"
}
}
},
{
"fromTopics": [
"ws/test1",
"ws/test2"
],
"toTopic": "computed/combineLatest",
"emitType": "combineLatest",
"template": {
"firstNum": "${messages[0].numParam}",
"secondNum": "${messages[1].numParam}",
"sum": {
"$eval": "messages[0].numParam + messages[1].numParam"
}
}
},
{
"fromTopic": "computed/filter/+",
"toTopicTemplate": "f_${topic}_NEW",
"emitInterval": 60,
"topicKeyToMessage": "topic",
"emitType": "map",
"useConstants": {
"sth": "secToHour"
},
"template": {
"responseStatus": {
"$eval": "responseStatus"
},
"secToHour": "${sth}"
}
},
{
"emitType": "constant",
"name": "secToHour",
"value": 3600
}
]
}