test: gocr by font

master
Sean McBride 3 years ago
parent e87fe8ddcf
commit 625d9a7f32

@ -12,12 +12,12 @@ run:
debug:
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json"
client-dejavu_sans_mono:
client-mono:
mkdir -p tmp
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt
pango-view --font="DejaVu Sans 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_mono"
rm -rf tmp
client-roboto:
@ -25,13 +25,13 @@ client-roboto:
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt
pango-view --font="Roboto" -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_roboto"
rm -rf tmp
client-cascadia_code:
client-cascadia:
mkdir -p tmp
shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt
pango-view --font="Cascadia Code" -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_cascadia"
rm -rf tmp

@ -34,10 +34,10 @@ experiment_client() {
# Perform Experiments
printf "Running Experiments\n"
local -ra fonts=("DejaVu Sans Mono" "Roboto" "Cascadia Code")
local -Ar font_to_port=(
["DejaVu Sans Mono"]=10000
["Roboto"]=10001
["Cascadia Code"]=10002
local -Ar font_to_path=(
["DejaVu Sans Mono"]=/gocr_mono
["Roboto"]=/gocr_roboto
["Cascadia Code"]=/gocr_cascadia
)
local words
for ((i = 1; i <= iteration_count; i++)); do
@ -49,7 +49,7 @@ experiment_client() {
pango-view --font="$font" -qo "${font_file}_words.png" -t "$words" || exit 1
pngtopnm "${font_file}_words.png" > "${font_file}_words.pnm"
result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @"${font_file}_words.pnm" "$hostname:${font_to_port[$font]}" --silent -w "%{stderr}%{time_total}\n" 2>> "$results_directory/${font_file}_time.txt")
result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @"${font_file}_words.pnm" "$hostname:10000${font_to_path[$font]}" --silent -w "%{stderr}%{time_total}\n" 2>> "$results_directory/${font_file}_time.txt")
rm "${font_file}"_words.png "${font_file}"_words.pnm

@ -1,32 +1,32 @@
[
{
"name": "gocr_mono",
"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_urw_gothic",
"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_lobster_2",
"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_mono",
"path": "gocr.wasm.so",
"expected-execution-us": 5000,
"relative-deadline-us": 36000,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
},
{
"route": "/gocr_roboto",
"path": "gocr.wasm.so",
"expected-execution-us": 5000,
"relative-deadline-us": 36000,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
},
{
"route": "/gocr_cascadia",
"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