forked from the-benchmarker/web-frameworks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
79 lines (72 loc) · 2.95 KB
/
Copy pathrun.sh
File metadata and controls
79 lines (72 loc) · 2.95 KB
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
71
72
73
74
75
76
77
78
79
BASEDIR=`pwd`
# zrk is the load generator every `collect` target shells out to, and nothing
# in this repo installs it. Without this check a missing zrk surfaces as a
# "command not found" per framework, hours into a run, with empty .results and
# a `make` that kept going -- so fail here instead, before the first build.
#
# The version is checked too, not just the presence. A too-old zrk does not
# fail loudly: it rejects the unknown flag per invocation, which is the same
# "empty .results, make kept going" outcome the presence check exists to
# prevent -- and the check used to claim a minimum it never enforced.
ZRK_MIN=2.4.0 # --closed needs 2.2.0; 2.4.x is what the harness was validated on and
# carries the 2.2.2 fix that halved the generator's per-request overhead
zrk_install_help() {
echo "" >&2
echo "Install it with one of:" >&2
echo " brew install zoxy-io/tap/zrk" >&2
echo " https://github.com/zoxy-io/zrk/releases (static binaries)" >&2
}
if ! command -v zrk > /dev/null 2>&1; then
echo "zrk not found on PATH." >&2
zrk_install_help
echo "" >&2
echo "The collect targets need zrk >= ${ZRK_MIN}." >&2
exit 1
fi
ZRK_VERSION=`zrk --version 2>/dev/null | awk '{print $2}'`
if [ -z "$ZRK_VERSION" ]; then
echo "could not read a version from \`zrk --version\`." >&2
echo "Is the zrk on PATH really zoxy-io/zrk?" >&2
exit 1
fi
# sort -V puts the lower version first, so the minimum leading means it is met
# (equal versions sort either way and both satisfy it).
if [ "`printf '%s\n%s\n' "$ZRK_MIN" "$ZRK_VERSION" | sort -V | head -n1`" != "$ZRK_MIN" ]; then
echo "zrk ${ZRK_VERSION} is too old; the collect targets need >= ${ZRK_MIN}." >&2
echo "(The collect targets run --closed; the harness is validated on 2.4.x.)" >&2
zrk_install_help
exit 1
fi
if [ "$#" -eq 0 ]; then
find . -mindepth 3 -type f -name config.yaml | grep -Ev 'imi-swoole' > ~/list.txt
else
COUNT=`echo $1 | grep -c "/"`
if [ "$COUNT" -eq 0 ]; then
find $1 -mindepth 2 -type f -name config.yaml > ~/list.txt
elif [ "$COUNT" -eq 1 ] ; then
find $1 -mindepth 1 -type f -name config.yaml > ~/list.txt
else
echo "Illegal number of parameters" >&2
exit 2
fi
fi
while read line ; do
echo "*********** ${line} *************"
LANGUAGE=`echo $line | awk -F '/' '{print $(NF-2)}'`
FRAMEWORK=`echo $line | awk -F '/' '{print $(NF-1)}'`
rm -fr ${BASEDIR}/${LANGUAGE}/${FRAMEWORK}/.results
mkdir -p ${BASEDIR}/${LANGUAGE}/${FRAMEWORK}/.results/{64,256,512}
make -f ${BASEDIR}/${LANGUAGE}/${FRAMEWORK}/.Makefile build
sleep 60
make -f ${BASEDIR}/${LANGUAGE}/${FRAMEWORK}/.Makefile test
ret=$?
if [ $ret -eq 0 ]; then
make -f ${BASEDIR}/${LANGUAGE}/${FRAMEWORK}/.Makefile warmup
# make -f ${BASEDIR}/${LANGUAGE}/${FRAMEWORK}/.Makefile memory-idle
make -f ${BASEDIR}/${LANGUAGE}/${FRAMEWORK}/.Makefile collect
sleep 5
else
echo "Failure in ${LANGUAGE}/${FRAMEWORK}"
fi
make -f ${BASEDIR}/${LANGUAGE}/${FRAMEWORK}/.Makefile unbuild
done < ~/list.txt