test: gocr by_dpi

master
Sean McBride 3 years ago
parent 3b05fb647c
commit e87fe8ddcf

@ -17,7 +17,7 @@ client-72dpi:
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt 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 pango-view --dpi=72 --font=mono -qo tmp/72_dpi.png tmp/10_words.txt
pngtopnm tmp/72_dpi.png > tmp/72_dpi.pnm 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 rm -rf tmp
client-108dpi: client-108dpi:
@ -25,7 +25,7 @@ client-108dpi:
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt 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 pango-view --dpi=108 --font=mono -qo tmp/108_dpi.png tmp/10_words.txt
pngtopnm tmp/108_dpi.png > tmp/108_dpi.pnm 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 rm -rf tmp
client-144dpi: client-144dpi:
@ -33,5 +33,5 @@ client-144dpi:
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt 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 pango-view --dpi=144 --font=mono -qo tmp/144_dpi.png tmp/10_words.txt
pngtopnm tmp/144_dpi.png > tmp/144_dpi.pnm 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 rm -rf tmp

@ -34,10 +34,10 @@ experiment_client() {
# Perform Experiments # Perform Experiments
printf "Running Experiments\n" printf "Running Experiments\n"
local -ar dpis=(72 108 144) local -ar dpis=(72 108 144)
local -Ar dpi_to_port=( local -Ar dpi_to_path=(
[72]=10000 [72]=/gocr_72_dpi
[108]=10001 [108]=/gocr_108_dpi
[144]=10002 [144]=/gocr_144_dpi
) )
local words local words
for ((i = 0; i < iteration_count; i++)); do 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" pango-view --dpi="$dpi" --font=mono -qo "${dpi}"_dpi.png -t "$words"
pngtopnm "${dpi}"_dpi.png > "${dpi}"_dpi.pnm 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 rm "${dpi}"_dpi.png "${dpi}"_dpi.pnm

@ -1,32 +1,32 @@
[ [
{ {
"name": "gocr_72_dpi", "name": "gwu",
"path": "gocr.wasm.so",
"port": 10000, "port": 10000,
"routes": [
{
"route": "/gocr_72_dpi",
"path": "gocr.wasm.so",
"expected-execution-us": 5000, "expected-execution-us": 5000,
"relative-deadline-us": 36000, "relative-deadline-us": 36000,
"http-req-size": 5335057,
"http-resp-size": 5335057, "http-resp-size": 5335057,
"http-resp-content-type": "text/plain" "http-resp-content-type": "text/plain"
}, },
{ {
"name": "gocr_108_dpi", "route": "/gocr_108_dpi",
"path": "gocr.wasm.so", "path": "gocr.wasm.so",
"port": 10001,
"expected-execution-us": 5000, "expected-execution-us": 5000,
"relative-deadline-us": 36000, "relative-deadline-us": 36000,
"http-req-size": 5335057,
"http-resp-size": 5335057, "http-resp-size": 5335057,
"http-resp-content-type": "text/plain" "http-resp-content-type": "text/plain"
}, },
{ {
"name": "gocr_144_dpi", "route": "/gocr_144_dpi",
"path": "gocr.wasm.so", "path": "gocr.wasm.so",
"port": 10002,
"expected-execution-us": 5000, "expected-execution-us": 5000,
"relative-deadline-us": 36000, "relative-deadline-us": 36000,
"http-req-size": 5335057,
"http-resp-size": 5335057, "http-resp-size": 5335057,
"http-resp-content-type": "text/plain" "http-resp-content-type": "text/plain"
} }
] ]
}
]
Loading…
Cancel
Save