Commit 8cb87d23 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

récupération des dimensions de l'image par curl + jq

parent 2de292c2
......@@ -3,6 +3,7 @@
## Requirements
* [Siege](https://github.com/JoeDog/siege) - Debian package available.
* jq - Debian package available.
## Usage
......
......@@ -7,6 +7,9 @@ N_RUNS=10
N_URLS=2000
N_TESTS=1
MAX_WIDTH=1920
MAX_HEIGHT=1080
display_usage(){
echo ""
echo " IIPserver benchtest"
......@@ -52,13 +55,16 @@ run(){
rm *.txt
fi
width=$(curl -s -k $ENDPOINT'info.json'|jq .width)
height=$(curl -s -k $ENDPOINT'info.json'|jq .height)
for ((i=1;i<=$N_URLS;i++));
do
x=$(( ( RANDOM % 45000) ))
y=$(( ( RANDOM % 5550) ))
w=$(( ( RANDOM % 3000) ))
h=$(( ( RANDOM % 1000) ))
url=$ENDPOINT$x','$y','$w','$h'/256,/0/default.jpg'
w=$(( RANDOM % $MAX_WIDTH ))
h=$(( RANDOM % $MAX_HEIGHT ))
x=$(( ( RANDOM % ($width-$w)) ))
y=$(( ( RANDOM % ($height-$h)) ))
tile_width=$(( (RANDOM % ($w-1)) + 1 ))
url=$ENDPOINT$x','$y','$w','$h'/'$tile_width',/0/default.jpg'
echo $url >>$URLS_FILE
done
siege -v -c$N_CLIENTS -r$N_RUNS -f $URLS_FILE > out-$1.txt
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment