Skip to content

Commit b7f562f

Browse files
koleiniedsiper
authored andcommitted
sp: add tests for Stream Processor hopping window
Signed-off-by: Masoud Koleini <[email protected]>
1 parent d14c1fc commit b7f562f

File tree

16 files changed

+192
-62
lines changed

16 files changed

+192
-62
lines changed

tests/internal/data/stream_processor/gen_msgpack.sh

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
echo "=== Just hit ctrl-c after 2 seconds... ==="
3+
echo "=== Hit ctrl-c if it runs forever!... ==="
44
echo
55

66
# Delete old samples file
@@ -11,4 +11,30 @@ rm -rf samples.mp samples-subkeys.mp
1111
-i tail -t samples -p path=samples.json -p parser=json \
1212
-i tail -t samples-subkeys -p path=samples-subkeys.json -p parser=json \
1313
-o file -m samples -p format=msgpack -p path=samples.mp \
14-
-o file -m samples-subkeys -p format=msgpack -p path=samples-subkeys.mp -f 1
14+
-o file -m samples-subkeys -p format=msgpack -p path=samples-subkeys.mp -f 1 &
15+
pid=$!
16+
sleep 2
17+
kill -9 $pid
18+
19+
# Generate new msgpack files for hopping window
20+
files=$(find "samples-hw/" -type f -name "*.mp")
21+
22+
for file in $files
23+
do
24+
rm -f $file
25+
done
26+
27+
files=$(find "samples-hw/" -type f -name "*.json")
28+
29+
for file in $files
30+
do
31+
# Generate new msgpack files for hopping window
32+
echo ""
33+
echo "=== Generating MessagePack file for $file ... ==="
34+
../../../../build/bin/fluent-bit -R ../../../../conf/parsers.conf \
35+
-i tail -p path=$file -p parser=json \
36+
-o file -p format=msgpack -p path=$(echo $file | sed s/json/mp/) -f 1 &
37+
pid=$!
38+
sleep 2
39+
kill -9 $pid
40+
done
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{"id": 0, "word1": "fluent" , "word2": "logging" , "bytes": 10 , "bool": true}
2+
{"id": 1, "word1": "fluentd" , "word2": "rlz" , "bytes": 10.0 , "bool": true}
3+
{"id": 2, "word1": "fluent-bit" , "word3": "rlz" , "bytes": 10 , "bool": true}
4+
{"id": 3, "word1": "fluent-logger" , "word3": "" , "bytes": 10 , "bool": true}
229 Bytes
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{"id": 4, "word1": "forward" , "word3": "plain" , "bytes": 10 , "bool": true}
2+
{"id": 5, "word5": "forward-protocol", "word6": "secure" , "bytes": 10 , "bool": true}
3+
{"id": 6, "word1": "stream" , "word3": "processing" , "bytes": 10.20 , "bool": false}
4+
{"id": 7, "word1": "edge-rocks" , "word6": "" , "bytes": 10 , "bool": true}
240 Bytes
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{"id": 8, "word1": "treasure-data" , "word3": "cncf" , "bytes": 10 , "bool": true}
2+
{"id": 9, "word1": "arm" , "word3": "linux foundation", "bytes": "10.30", "bool": false}
3+
{"id": 10, "word1": "fluent-bit" , "word3": null , "bytes": 10 , "bool": true}
180 Bytes
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{"id": 0, "word1": "fluent" , "word2": "logging" , "bytes": 10 , "bool": true}
2+
{"id": 1, "word1": "fluentd" , "word2": "rlz" , "bytes": 10.0 , "bool": true}
3+
{"id": 2, "word1": "fluent-bit" , "word3": "rlz" , "bytes": 10 , "bool": true}
4+
{"id": 3, "word1": "fluent-logger" , "word3": "" , "bytes": 10 , "bool": true}
229 Bytes
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{"id": 4, "word1": "forward" , "word3": "plain" , "bytes": 10 , "bool": true}
2+
{"id": 5, "word5": "forward-protocol", "word6": "secure" , "bytes": 10 , "bool": true}
3+
{"id": 6, "word1": "stream" , "word3": "processing" , "bytes": 10.20 , "bool": false}
4+
{"id": 7, "word1": "edge-rocks" , "word6": "" , "bytes": 10 , "bool": true}

0 commit comments

Comments
 (0)