test: gocr by_word

master
Sean McBride 3 years ago
parent 162cdcd4bf
commit 1e7b95c25c

@ -17,5 +17,13 @@ client-10:
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt
pango-view --font=mono -qo tmp/10_words.png tmp/10_words.txt
pngtopnm tmp/10_words.png > tmp/10_words.pnm
curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/10_words.pnm" "${HOSTNAME}:10000"
curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/10_words.pnm" "${HOSTNAME}:10000/gocr_10_words"
rm -rf tmp
client-100:
mkdir -p tmp
shuf -n100 /usr/share/dict/american-english > tmp/100_words.txt
pango-view --font=mono -qo tmp/100_words.png tmp/100_words.txt
pngtopnm tmp/100_words.png > tmp/100_words.pnm
curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/100_words.pnm" "${HOSTNAME}:10000/gocr_100_words"
rm -rf tmp

@ -34,10 +34,10 @@ experiment_client() {
# Write Headers to CSV files
local -Ar word_count_to_port=(
["1_words"]=10000
["10_words"]=10001
["100_words"]=10002
local -Ar word_count_to_path=(
["1_words"]=/gocr_1_word
["10_words"]=/gocr_10_words
["100_words"]=/gocr_100_words
)
local words
@ -50,7 +50,7 @@ experiment_client() {
pango-view --font=mono -qo "$word_count_file.png" -t "$words" || exit 1
pngtopnm "$word_count_file.png" > "$word_count_file.pnm" || exit 1
result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @"$word_count_file.pnm" "$hostname:${word_count_to_port[$word_count_file]}" --silent -w "%{stderr}%{time_total}\n" 2>> "$results_directory/${word_count_file}_time.txt")
result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @"$word_count_file.pnm" "$hostname:10000${word_count_to_path[$word_count_file]}" --silent -w "%{stderr}%{time_total}\n" 2>> "$results_directory/${word_count_file}_time.txt")
# If the OCR does not produce a guess, fail
[[ -z "$result" ]] && exit 1

@ -1,32 +1,32 @@
[
{
"name": "gocr_1_word",
"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_10_words",
"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_100_words",
"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_1_word",
"path": "gocr.wasm.so",
"expected-execution-us": 5000,
"relative-deadline-us": 36000,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
},
{
"route": "/gocr_10_words",
"path": "gocr.wasm.so",
"expected-execution-us": 5000,
"relative-deadline-us": 36000,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
},
{
"route": "/gocr_100_words",
"path": "gocr.wasm.so",
"expected-execution-us": 5000,
"relative-deadline-us": 36000,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
}
]
}
]

Loading…
Cancel
Save