-
-
Notifications
You must be signed in to change notification settings - Fork 492
Expand file tree
/
Copy pathbenchmark.sh
More file actions
executable file
·33 lines (28 loc) · 714 Bytes
/
benchmark.sh
File metadata and controls
executable file
·33 lines (28 loc) · 714 Bytes
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
#!/bin/bash
#
# Simple benchmark test suite
#
# You must have installed vegeta:
# go get github.com/tsenart/vegeta
#
# Default port to listen
port=8088
# Start the server
./bin/imaginary -p $port & > /dev/null
pid=$!
suite() {
echo "$1 --------------------------------------"
echo "POST http://localhost:$port/$2" | vegeta attack \
-duration=30s \
-rate=50 \
-body="./testdata/large.jpg" \ | vegeta report
sleep 1
}
# Run suites
suite "Crop" "crop?width=800&height=600"
suite "Resize" "resize?width=200"
#suite "Rotate" "rotate?rotate=180"
#suite "Enlarge" "enlarge?width=1600&height=1200"
suite "Extract" "extract?top=50&left=50&areawidth=200&areaheight=200"
# Kill the server
kill -9 $pid