node-red-contrib-questdb 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/examples.json +924 -0
- package/nodes/mapper.html +25 -3
- package/nodes/mapper.js +28 -2
- package/nodes/write.js +63 -1
- package/package.json +1 -1
- package/examples/comprehensive-test-flows.json +0 -908
- package/examples/test-flows.json +0 -330
package/examples/test-flows.json
DELETED
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "questdb-test-tab",
|
|
4
|
-
"type": "tab",
|
|
5
|
-
"label": "QuestDB Test Flows",
|
|
6
|
-
"disabled": false,
|
|
7
|
-
"info": "Test flows for node-red-contrib-questdb"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"id": "comment-intro",
|
|
11
|
-
"type": "comment",
|
|
12
|
-
"z": "questdb-test-tab",
|
|
13
|
-
"name": "QuestDB Test Flows - Click inject nodes to test",
|
|
14
|
-
"info": "These flows demonstrate the QuestDB Write and Mapper nodes.\n\nMake sure QuestDB is running on localhost:9000 before testing.",
|
|
15
|
-
"x": 250,
|
|
16
|
-
"y": 40
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"id": "comment-flow1",
|
|
20
|
-
"type": "comment",
|
|
21
|
-
"z": "questdb-test-tab",
|
|
22
|
-
"name": "Flow 1: Direct Write (structured payload)",
|
|
23
|
-
"info": "",
|
|
24
|
-
"x": 200,
|
|
25
|
-
"y": 100
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "inject-direct",
|
|
29
|
-
"type": "inject",
|
|
30
|
-
"z": "questdb-test-tab",
|
|
31
|
-
"name": "Send structured data",
|
|
32
|
-
"props": [
|
|
33
|
-
{"p": "topic", "vt": "str"},
|
|
34
|
-
{"p": "payload"}
|
|
35
|
-
],
|
|
36
|
-
"repeat": "",
|
|
37
|
-
"crontab": "",
|
|
38
|
-
"once": false,
|
|
39
|
-
"onceDelay": 0.1,
|
|
40
|
-
"topic": "sensors",
|
|
41
|
-
"payload": "{\"symbols\":{\"device_id\":\"sensor_001\",\"location\":\"warehouse\"},\"columns\":{\"temperature\":23.5,\"humidity\":65.2,\"pressure\":1013.25},\"timestamp\":\"$timestamp\"}",
|
|
42
|
-
"payloadType": "json",
|
|
43
|
-
"x": 160,
|
|
44
|
-
"y": 160,
|
|
45
|
-
"wires": [["function-timestamp-direct"]]
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"id": "function-timestamp-direct",
|
|
49
|
-
"type": "function",
|
|
50
|
-
"z": "questdb-test-tab",
|
|
51
|
-
"name": "Add timestamp",
|
|
52
|
-
"func": "msg.payload.timestamp = Date.now();\nreturn msg;",
|
|
53
|
-
"outputs": 1,
|
|
54
|
-
"x": 360,
|
|
55
|
-
"y": 160,
|
|
56
|
-
"wires": [["questdb-write-1"]]
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"id": "questdb-write-1",
|
|
60
|
-
"type": "questdb",
|
|
61
|
-
"z": "questdb-test-tab",
|
|
62
|
-
"name": "Write to QuestDB",
|
|
63
|
-
"questdb": "questdb-config-1",
|
|
64
|
-
"autoFlush": true,
|
|
65
|
-
"flushInterval": 1000,
|
|
66
|
-
"x": 550,
|
|
67
|
-
"y": 160,
|
|
68
|
-
"wires": [["debug-result-1"]]
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"id": "debug-result-1",
|
|
72
|
-
"type": "debug",
|
|
73
|
-
"z": "questdb-test-tab",
|
|
74
|
-
"name": "Result",
|
|
75
|
-
"active": true,
|
|
76
|
-
"tosidebar": true,
|
|
77
|
-
"console": false,
|
|
78
|
-
"tostatus": true,
|
|
79
|
-
"complete": "payload",
|
|
80
|
-
"targetType": "msg",
|
|
81
|
-
"statusVal": "payload.success",
|
|
82
|
-
"statusType": "auto",
|
|
83
|
-
"x": 730,
|
|
84
|
-
"y": 160
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"id": "comment-flow2",
|
|
88
|
-
"type": "comment",
|
|
89
|
-
"z": "questdb-test-tab",
|
|
90
|
-
"name": "Flow 2: Using Mapper Node",
|
|
91
|
-
"info": "",
|
|
92
|
-
"x": 170,
|
|
93
|
-
"y": 240
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"id": "inject-mapper",
|
|
97
|
-
"type": "inject",
|
|
98
|
-
"z": "questdb-test-tab",
|
|
99
|
-
"name": "Raw sensor data",
|
|
100
|
-
"props": [
|
|
101
|
-
{"p": "payload"},
|
|
102
|
-
{"p": "topic", "vt": "str"}
|
|
103
|
-
],
|
|
104
|
-
"repeat": "",
|
|
105
|
-
"crontab": "",
|
|
106
|
-
"once": false,
|
|
107
|
-
"onceDelay": 0.1,
|
|
108
|
-
"topic": "raw_reading",
|
|
109
|
-
"payload": "{\"device\":\"temp_sensor_01\",\"reading\":22.7,\"battery\":85,\"ts\":\"$timestamp\"}",
|
|
110
|
-
"payloadType": "json",
|
|
111
|
-
"x": 150,
|
|
112
|
-
"y": 300,
|
|
113
|
-
"wires": [["function-timestamp-mapper"]]
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"id": "function-timestamp-mapper",
|
|
117
|
-
"type": "function",
|
|
118
|
-
"z": "questdb-test-tab",
|
|
119
|
-
"name": "Add timestamp",
|
|
120
|
-
"func": "msg.payload.ts = Date.now();\nreturn msg;",
|
|
121
|
-
"outputs": 1,
|
|
122
|
-
"x": 360,
|
|
123
|
-
"y": 300,
|
|
124
|
-
"wires": [["questdb-mapper-1"]]
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"id": "questdb-mapper-1",
|
|
128
|
-
"type": "questdb-mapper",
|
|
129
|
-
"z": "questdb-test-tab",
|
|
130
|
-
"name": "Map to ILP",
|
|
131
|
-
"tableName": "temperature_readings",
|
|
132
|
-
"timestampField": "payload.ts",
|
|
133
|
-
"symbolMappings": [
|
|
134
|
-
{"source": "payload.device", "target": "device_id"}
|
|
135
|
-
],
|
|
136
|
-
"columnMappings": [
|
|
137
|
-
{"source": "payload.reading", "target": "temperature", "type": "float"},
|
|
138
|
-
{"source": "payload.battery", "target": "battery_level", "type": "integer"}
|
|
139
|
-
],
|
|
140
|
-
"x": 550,
|
|
141
|
-
"y": 300,
|
|
142
|
-
"wires": [["debug-mapped", "questdb-write-2"]]
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"id": "debug-mapped",
|
|
146
|
-
"type": "debug",
|
|
147
|
-
"z": "questdb-test-tab",
|
|
148
|
-
"name": "Mapped output",
|
|
149
|
-
"active": true,
|
|
150
|
-
"tosidebar": true,
|
|
151
|
-
"console": false,
|
|
152
|
-
"tostatus": false,
|
|
153
|
-
"complete": "true",
|
|
154
|
-
"targetType": "full",
|
|
155
|
-
"x": 750,
|
|
156
|
-
"y": 260
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"id": "questdb-write-2",
|
|
160
|
-
"type": "questdb",
|
|
161
|
-
"z": "questdb-test-tab",
|
|
162
|
-
"name": "Write mapped data",
|
|
163
|
-
"questdb": "questdb-config-1",
|
|
164
|
-
"autoFlush": true,
|
|
165
|
-
"flushInterval": 1000,
|
|
166
|
-
"x": 770,
|
|
167
|
-
"y": 300,
|
|
168
|
-
"wires": [["debug-result-2"]]
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"id": "debug-result-2",
|
|
172
|
-
"type": "debug",
|
|
173
|
-
"z": "questdb-test-tab",
|
|
174
|
-
"name": "Write result",
|
|
175
|
-
"active": true,
|
|
176
|
-
"tosidebar": true,
|
|
177
|
-
"console": false,
|
|
178
|
-
"tostatus": true,
|
|
179
|
-
"complete": "payload",
|
|
180
|
-
"targetType": "msg",
|
|
181
|
-
"statusVal": "payload.success",
|
|
182
|
-
"statusType": "auto",
|
|
183
|
-
"x": 970,
|
|
184
|
-
"y": 300
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"id": "comment-flow3",
|
|
188
|
-
"type": "comment",
|
|
189
|
-
"z": "questdb-test-tab",
|
|
190
|
-
"name": "Flow 3: Simple numeric value (uses topic as tag)",
|
|
191
|
-
"info": "",
|
|
192
|
-
"x": 230,
|
|
193
|
-
"y": 380
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
"id": "inject-simple",
|
|
197
|
-
"type": "inject",
|
|
198
|
-
"z": "questdb-test-tab",
|
|
199
|
-
"name": "Simple value",
|
|
200
|
-
"props": [
|
|
201
|
-
{"p": "payload"},
|
|
202
|
-
{"p": "topic", "vt": "str"}
|
|
203
|
-
],
|
|
204
|
-
"repeat": "",
|
|
205
|
-
"crontab": "",
|
|
206
|
-
"once": false,
|
|
207
|
-
"onceDelay": 0.1,
|
|
208
|
-
"topic": "cpu_usage",
|
|
209
|
-
"payload": "45.7",
|
|
210
|
-
"payloadType": "num",
|
|
211
|
-
"x": 140,
|
|
212
|
-
"y": 440,
|
|
213
|
-
"wires": [["questdb-write-3"]]
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"id": "questdb-write-3",
|
|
217
|
-
"type": "questdb",
|
|
218
|
-
"z": "questdb-test-tab",
|
|
219
|
-
"name": "Write simple",
|
|
220
|
-
"questdb": "questdb-config-1",
|
|
221
|
-
"autoFlush": true,
|
|
222
|
-
"flushInterval": 1000,
|
|
223
|
-
"x": 350,
|
|
224
|
-
"y": 440,
|
|
225
|
-
"wires": [["debug-result-3"]]
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"id": "debug-result-3",
|
|
229
|
-
"type": "debug",
|
|
230
|
-
"z": "questdb-test-tab",
|
|
231
|
-
"name": "Result",
|
|
232
|
-
"active": true,
|
|
233
|
-
"tosidebar": true,
|
|
234
|
-
"console": false,
|
|
235
|
-
"tostatus": true,
|
|
236
|
-
"complete": "payload",
|
|
237
|
-
"targetType": "msg",
|
|
238
|
-
"statusVal": "payload.success",
|
|
239
|
-
"statusType": "auto",
|
|
240
|
-
"x": 530,
|
|
241
|
-
"y": 440
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"id": "comment-flow4",
|
|
245
|
-
"type": "comment",
|
|
246
|
-
"z": "questdb-test-tab",
|
|
247
|
-
"name": "Flow 4: Continuous data generation (for load testing)",
|
|
248
|
-
"info": "",
|
|
249
|
-
"x": 250,
|
|
250
|
-
"y": 520
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
"id": "inject-continuous",
|
|
254
|
-
"type": "inject",
|
|
255
|
-
"z": "questdb-test-tab",
|
|
256
|
-
"name": "Every 1 second",
|
|
257
|
-
"props": [
|
|
258
|
-
{"p": "payload"},
|
|
259
|
-
{"p": "topic", "vt": "str"}
|
|
260
|
-
],
|
|
261
|
-
"repeat": "1",
|
|
262
|
-
"crontab": "",
|
|
263
|
-
"once": false,
|
|
264
|
-
"onceDelay": 0.1,
|
|
265
|
-
"topic": "metrics",
|
|
266
|
-
"payload": "",
|
|
267
|
-
"payloadType": "date",
|
|
268
|
-
"x": 150,
|
|
269
|
-
"y": 580,
|
|
270
|
-
"wires": [["function-generate"]]
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
"id": "function-generate",
|
|
274
|
-
"type": "function",
|
|
275
|
-
"z": "questdb-test-tab",
|
|
276
|
-
"name": "Generate random metrics",
|
|
277
|
-
"func": "msg.payload = {\n symbols: {\n host: \"server-\" + Math.floor(Math.random() * 3 + 1),\n region: [\"us-east\", \"us-west\", \"eu-west\"][Math.floor(Math.random() * 3)]\n },\n columns: {\n cpu: Math.random() * 100,\n memory: Math.random() * 100,\n disk_io: Math.random() * 1000,\n network_in: Math.random() * 10000,\n network_out: Math.random() * 10000\n },\n timestamp: Date.now()\n};\nreturn msg;",
|
|
278
|
-
"outputs": 1,
|
|
279
|
-
"x": 390,
|
|
280
|
-
"y": 580,
|
|
281
|
-
"wires": [["questdb-write-4"]]
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"id": "questdb-write-4",
|
|
285
|
-
"type": "questdb",
|
|
286
|
-
"z": "questdb-test-tab",
|
|
287
|
-
"name": "Write metrics",
|
|
288
|
-
"questdb": "questdb-config-1",
|
|
289
|
-
"autoFlush": true,
|
|
290
|
-
"flushInterval": 1000,
|
|
291
|
-
"x": 610,
|
|
292
|
-
"y": 580,
|
|
293
|
-
"wires": [["debug-result-4"]]
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
"id": "debug-result-4",
|
|
297
|
-
"type": "debug",
|
|
298
|
-
"z": "questdb-test-tab",
|
|
299
|
-
"name": "Continuous result",
|
|
300
|
-
"active": false,
|
|
301
|
-
"tosidebar": true,
|
|
302
|
-
"console": false,
|
|
303
|
-
"tostatus": true,
|
|
304
|
-
"complete": "payload",
|
|
305
|
-
"targetType": "msg",
|
|
306
|
-
"statusVal": "payload.success",
|
|
307
|
-
"statusType": "auto",
|
|
308
|
-
"x": 810,
|
|
309
|
-
"y": 580
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
"id": "questdb-config-1",
|
|
313
|
-
"type": "questdb-config",
|
|
314
|
-
"name": "Local QuestDB",
|
|
315
|
-
"protocol": "http",
|
|
316
|
-
"host": "localhost",
|
|
317
|
-
"port": "9000",
|
|
318
|
-
"tlsVerify": true,
|
|
319
|
-
"tlsCa": "",
|
|
320
|
-
"autoFlush": true,
|
|
321
|
-
"autoFlushRows": "75000",
|
|
322
|
-
"autoFlushInterval": "1000",
|
|
323
|
-
"requestTimeout": "10000",
|
|
324
|
-
"retryTimeout": "10000",
|
|
325
|
-
"initBufSize": "65536",
|
|
326
|
-
"maxBufSize": "104857600",
|
|
327
|
-
"useAuth": false,
|
|
328
|
-
"authType": "basic"
|
|
329
|
-
}
|
|
330
|
-
]
|