From e87fe8ddcf84af8595cd3bd3e971dcb6c74fcc9b Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Tue, 26 Apr 2022 18:14:34 -0400 Subject: [PATCH] test: gocr by_dpi --- tests/gocr/by_dpi/Makefile | 6 ++-- tests/gocr/by_dpi/run.sh | 10 +++---- tests/gocr/by_dpi/spec.json | 56 ++++++++++++++++++------------------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/tests/gocr/by_dpi/Makefile b/tests/gocr/by_dpi/Makefile index 6cac070..00f9122 100644 --- a/tests/gocr/by_dpi/Makefile +++ b/tests/gocr/by_dpi/Makefile @@ -17,7 +17,7 @@ client-72dpi: shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt pango-view --dpi=72 --font=mono -qo tmp/72_dpi.png tmp/10_words.txt pngtopnm tmp/72_dpi.png > tmp/72_dpi.pnm - curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @tmp/72_dpi.pnm "${HOSTNAME}:10000" + curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @tmp/72_dpi.pnm "${HOSTNAME}:10000/gocr_72_dpi" rm -rf tmp client-108dpi: @@ -25,7 +25,7 @@ client-108dpi: shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt pango-view --dpi=108 --font=mono -qo tmp/108_dpi.png tmp/10_words.txt pngtopnm tmp/108_dpi.png > tmp/108_dpi.pnm - curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @tmp/108_dpi.pnm "${HOSTNAME}:10001" + curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @tmp/108_dpi.pnm "${HOSTNAME}:10000/gocr_108_dpi" rm -rf tmp client-144dpi: @@ -33,5 +33,5 @@ client-144dpi: shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt pango-view --dpi=144 --font=mono -qo tmp/144_dpi.png tmp/10_words.txt pngtopnm tmp/144_dpi.png > tmp/144_dpi.pnm - curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @tmp/144_dpi.pnm "${HOSTNAME}:10002" + curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @tmp/144_dpi.pnm "${HOSTNAME}:10000/gocr_144_dpi" rm -rf tmp diff --git a/tests/gocr/by_dpi/run.sh b/tests/gocr/by_dpi/run.sh index 9f54620..9720bbb 100755 --- a/tests/gocr/by_dpi/run.sh +++ b/tests/gocr/by_dpi/run.sh @@ -34,10 +34,10 @@ experiment_client() { # Perform Experiments printf "Running Experiments\n" local -ar dpis=(72 108 144) - local -Ar dpi_to_port=( - [72]=10000 - [108]=10001 - [144]=10002 + local -Ar dpi_to_path=( + [72]=/gocr_72_dpi + [108]=/gocr_108_dpi + [144]=/gocr_144_dpi ) local words for ((i = 0; i < iteration_count; i++)); do @@ -47,7 +47,7 @@ experiment_client() { pango-view --dpi="$dpi" --font=mono -qo "${dpi}"_dpi.png -t "$words" pngtopnm "${dpi}"_dpi.png > "${dpi}"_dpi.pnm - result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @"${dpi}"_dpi.pnm "$hostname:${dpi_to_port[$dpi]}" --silent -w "%{stderr}%{time_total}\n" 2>> "$results_directory/${dpi}_time.txt") + result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @"${dpi}"_dpi.pnm "$hostname:10000${dpi_to_path[$dpi]}" --silent -w "%{stderr}%{time_total}\n" 2>> "$results_directory/${dpi}_time.txt") rm "${dpi}"_dpi.png "${dpi}"_dpi.pnm diff --git a/tests/gocr/by_dpi/spec.json b/tests/gocr/by_dpi/spec.json index a5fb6bb..d83fb7a 100644 --- a/tests/gocr/by_dpi/spec.json +++ b/tests/gocr/by_dpi/spec.json @@ -1,32 +1,32 @@ [ { - "name": "gocr_72_dpi", - "path": "gocr.wasm.so", + "name": "gwu", "port": 10000, - "expected-execution-us": 5000, - "relative-deadline-us": 36000, - "http-req-size": 5335057, - "http-resp-size": 5335057, - "http-resp-content-type": "text/plain" - }, - { - "name": "gocr_108_dpi", - "path": "gocr.wasm.so", - "port": 10001, - "expected-execution-us": 5000, - "relative-deadline-us": 36000, - "http-req-size": 5335057, - "http-resp-size": 5335057, - "http-resp-content-type": "text/plain" - }, - { - "name": "gocr_144_dpi", - "path": "gocr.wasm.so", - "port": 10002, - "expected-execution-us": 5000, - "relative-deadline-us": 36000, - "http-req-size": 5335057, - "http-resp-size": 5335057, - "http-resp-content-type": "text/plain" + "routes": [ + { + "route": "/gocr_72_dpi", + "path": "gocr.wasm.so", + "expected-execution-us": 5000, + "relative-deadline-us": 36000, + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" + }, + { + "route": "/gocr_108_dpi", + "path": "gocr.wasm.so", + "expected-execution-us": 5000, + "relative-deadline-us": 36000, + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" + }, + { + "route": "/gocr_144_dpi", + "path": "gocr.wasm.so", + "expected-execution-us": 5000, + "relative-deadline-us": 36000, + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" + } + ] } -] +] \ No newline at end of file