-
Notifications
You must be signed in to change notification settings - Fork 83
/
load-okapi.sh
executable file
·49 lines (37 loc) · 1.03 KB
/
load-okapi.sh
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
#!/bin/bash
#
# A simple script to put some load on Okapi
# Assumes we have set things up as in the guide, or via okapi-examples.sh
#
OKAPI=${1:-"http://localhost:9130"}
MODULE=${2:-'testb'} # module to invoke, default: okapi-test-module (testb)
temp_file='/tmp/okapi-load.txt'
function cleanup {
rm -f $temp_file
}
trap cleanup EXIT
cat > $temp_file <<END
Simple POST request to the $MODULE module.
END
while true
do
for I in 1 2 3 4 5 6 7 8 9 10
do
#curl -s -w '\n' \
# -H "X-Okapi-Tenant: testlib" \
# -H "X-Okapi-Token: dummyJwt.eyJzdWIiOiJwZXRlciIsInRlbmFudCI6InRlc3RsaWIifQ==.sig" \
# $OKAPI/$MODULE
curl -s -w '\n' \
-H "Content-type: application/json" \
-H "X-Okapi-Tenant: testlib" \
-H "X-Okapi-Token: dummyJwt.eyJzdWIiOiJwZXRlciIsInRlbmFudCI6InRlc3RsaWIifQ==.sig" \
-X POST -d @$temp_file \
$OKAPI/$MODULE
done
#curl -s -w '\n' -D - \
# -H "X-Okapi-Tenant: testlib" \
# -H "X-Okapi-Token: other:peter:BAD-TOKEN" \
# $OKAPI/$MODULE
sleep 0.1
date
done