-
Notifications
You must be signed in to change notification settings - Fork 6
/
benchmark
executable file
·70 lines (59 loc) · 1.69 KB
/
benchmark
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
set -e
# Silence pushd and popd
pushd () {
command pushd "$@" > /dev/null
}
popd () {
command popd "$@" > /dev/null
}
usage() {
echo -n "$(basename $0) [OPTION]...
Run benchmarks. Must have server running at localhost:8090/
Options:
--sync Run synchronous benchmarks, for all /run endpoints
--mapshed Submit multiple requests to /run,
and single to /multi for Schuylkill HUC-8
--subbasin Submit multiple requests to /run,
and single to /multi for all 61 HUC-12s
within Schuylkill HUC-8
-h, --help Display this help text
"
}
# Handle options
while [[ -n $1 ]]; do
case $1 in
--sync) ENABLE_SYNC=1 ;;
--mapshed) ENABLE_MAPSHED=1 ;;
--subbasin) ENABLE_SUBBASIN=1 ;;
-h|--help|*) usage; exit 1 ;;
esac
shift
done
pushd scripts
if [ -n "$ENABLE_SYNC" ]; then
pipenv run python benchmark-sync --rga --rlj --rs
fi
if [ -n "$ENABLE_MAPSHED" ]; then
pipenv run python benchmark-sync --mapshed
echo "Timing HUC8 MapShed, separate requests per operation ->"
echo
for i in `seq 1 5`; do
{ time -p pipenv run python benchmark-mapshed > /dev/null; } 2>&1 |\
grep real |\
awk "{print \"HUC8 MapShed, 7 operations, run $i -> \" \$2 \" s\"}"
done
echo
fi
if [ -n "$ENABLE_SUBBASIN" ]; then
pipenv run python benchmark-sync --subbasin
echo "Timing 61 HUC12 Subbasin, separate requests per operation ->"
echo
for i in `seq 1 5`; do
{ time -p pipenv run python benchmark-subbasin > /dev/null; } 2>&1 |\
grep real |\
awk "{print \"61 HUC12 Subbasin, 7 operations, run $i -> \" \$2 \" s\"}"
done
echo
fi
popd