summaryrefslogtreecommitdiff
path: root/src/hub/test-client
blob: 620d9a446e12992e77dc4022847a19d908f0bcd2 (plain) (blame)
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
#!/bin/bash

TEST_D="./test"

case $1 in
  pipe)
    echo "pipe: send sample-pipe.json"
    echo "---------------------------"
    time socat file:../../dat/sample-pipe.json,rdonly "unix-client:$TEST_D/pipe"
    echo ""
    ;;
  pipegram)
    echo "pipe-gram: send sample-pipegram.json"
    echo "------------------------------------"
    time $(while read x; do echo "$x" | socat stdio "unix-sendto:$TEST_D/pipegram"; done < ../../dat/sample-pipegram.json)
    echo ""
    ;;
  web)
    echo "web: post sample-web.json"
    echo "-------------------------"
    time curl 'http://localhost:8000/updates' -d @../../dat/sample-web.json
    echo ""
    ;;
  web-bulk)
    echo "web: post sample-web-bulk.json"
    echo "------------------------------"
    time curl 'http://localhost:8000/updates/_bulk' -d @../../dat/sample-web-bulk.json
    echo ""
    ;;
esac

echo "store contents"
echo "--------------"
curl 'http://localhost:8000/updates/_bulk' | jq .
echo ""