6SLOWURL="http://localhost:8000/slow/2"
7FASTURL="http://localhost:8000/get/$SIZE"
8PROXYURL="http://localhost:8000/proxy"
10# we use binary, as there's some size
11TESTFILE="$(cabal-plan list-bin servant-machines:test:example)"
14CURLSTATS="time: %{time_total}, size: %{size_download}, download speed: %{speed_download}\n"
19 if [ ! -z "$MACHINES_PID" ]; then
20 kill "$MACHINES_PID" || true
23 if [ ! -z "$CONDUIT_PID" ]; then
24 kill "$CONDUIT_PID" || true
27 if [ ! -z "$PIPES_PID" ]; then
28 kill "$PIPES_PID" || true
31 if [ ! -z "$COOKBOOK_PID" ]; then
32 kill "$COOKBOOK_PID" || true
41 echo "\e[36m=== $1 ===\e[0m"
45#######################################################################
49bench "server machines"
51$(cabal-plan list-bin servant-machines:test:example) server +RTS -sbench-machines-server-rts.txt &
53echo "Starting servant-machines server. PID=$MACHINES_PID"
58# Run slow url to test & warm-up server
61curl --silent --show-error "$FASTURL" --output /dev/null --write-out "$CURLSTATS" > bench-machines-server.txt
63curl --silent --show-error "$PROXYURL" --request POST --data-binary @"$TESTFILE" --output "$TMPFILE" --write-out "$CURLSTATS" > bench-machines-server-proxy.txt
65kill -INT $MACHINES_PID
72$(cabal-plan list-bin servant-pipes:test:example) server +RTS -sbench-pipes-server-rts.txt &
74echo "Starting servant-pipes server. PID=$PIPES_PID"
79# Run slow url to test & warm-up server
82curl --silent --show-error "$FASTURL" --output /dev/null --write-out "$CURLSTATS" > bench-pipes-server.txt
84curl --silent --show-error "$PROXYURL" --request POST --data-binary @"$TESTFILE" --output "$TMPFILE" --write-out "$CURLSTATS" > bench-pipes-server-proxy.txt
91bench "server cookbook"
93$(cabal-plan list-bin cookbook-basic-streaming) server +RTS -sbench-cookbook-server-rts.txt &
95echo "Starting servant-cookbook server. PID=$COOKBOOK_PID"
100# Run slow url to test & warm-up server
103curl --silent --show-error "$FASTURL" --output /dev/null --write-out "$CURLSTATS" > bench-cookbook-server.txt
105curl --silent --show-error "$PROXYURL" --request POST --data-binary @"$TESTFILE" --output "$TMPFILE" --write-out "$CURLSTATS" > bench-cookbook-server-proxy.txt
107kill -INT $COOKBOOK_PID
112bench "server conduit"
114$(cabal-plan list-bin servant-conduit:test:example) server +RTS -sbench-conduit-server-rts.txt &
116echo "Starting servant-conduit server. PID=$CONDUIT_PID"
121# Run slow url to test & warm-up server
124curl --silent --show-error "$FASTURL" --output /dev/null --write-out "$CURLSTATS" > bench-conduit-server.txt
126curl --silent --show-error "$PROXYURL" --request POST --data-binary @"$TESTFILE" --output "$TMPFILE" --write-out "$CURLSTATS" > bench-conduit-server-proxy.txt
128# kill -INT $CONDUIT_PID
132#######################################################################
134# Uses conduit as server
138bench "client machines"
141$(cabal-plan list-bin servant-machines:test:example) client 10
144/usr/bin/time --verbose --output bench-machines-client-time.txt \
145 "$(cabal-plan list-bin servant-machines:test:example)" client "$SIZE" +RTS -sbench-machines-client-rts.txt
152$(cabal-plan list-bin servant-pipes:test:example) client 10
155/usr/bin/time --verbose --output bench-pipes-client-time.txt \
156 "$(cabal-plan list-bin servant-pipes:test:example)" client "$SIZE" +RTS -sbench-pipes-client-rts.txt
160bench "client conduit"
163$(cabal-plan list-bin servant-conduit:test:example) client 10
166/usr/bin/time --verbose --output bench-conduit-client-time.txt \
167 "$(cabal-plan list-bin servant-conduit:test:example)" client "$SIZE" +RTS -sbench-conduit-client-rts.txt
171bench "server cookbook"
174$(cabal-plan list-bin cookbook-basic-streaming) client 10
177/usr/bin/time --verbose --output bench-cookbook-client-time.txt \
178 "$(cabal-plan list-bin cookbook-basic-streaming)" client "$SIZE" +RTS -sbench-cookbook-client-rts.txt
182kill -INT $CONDUIT_PID
187#######################################################################
196 echo "\`\`\`" >> bench.md
198 echo "\`\`\`" >> bench.md
203 echo "\`\`\`" >> bench.md
204 cat "$1" | sed 's/^\s*//' >> bench.md
205 echo "\`\`\`" >> bench.md
210 echo "$1" >> bench.md
216header "#" "Streaming test benchmark"
217note "size parameter: $SIZE"
221note "- /fast/$SIZE\n- /proxy"
224report bench-machines-server.txt
225report bench-machines-server-proxy.txt
226report bench-machines-server-rts.txt
229report bench-pipes-server.txt
230report bench-pipes-server-proxy.txt
231report bench-pipes-server-rts.txt
234note "Conduit server is also used for client tests below"
235report bench-conduit-server.txt
236report bench-conduit-server-proxy.txt
237report bench-conduit-server-rts.txt
240report bench-cookbook-server.txt
241report bench-cookbook-server-proxy.txt
242report bench-cookbook-server-rts.txt
247report2 bench-machines-client-time.txt
248report bench-machines-client-rts.txt
251report2 bench-pipes-client-time.txt
252report bench-pipes-client-rts.txt
255report2 bench-conduit-client-time.txt
256report bench-conduit-client-rts.txt
259report2 bench-cookbook-client-time.txt
260report bench-cookbook-client-rts.txt
263sed -E -i 's/\/[^ ]*machines[^ ]*\/example/...machines:example/' bench.md
264sed -E -i 's/\/[^ ]*conduit[^ ]*\/example/...conduit:example/' bench.md
265sed -E -i 's/\/[^ ]*pipes[^ ]*\/example/...pipes:example/' bench.md
266sed -E -i 's/\/[^ ]*\/cookbook-basic-streaming/...cookbook-basic-streaming/' bench.md
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list