Skip to content

Commit

Permalink
[benchpress] Allow run.sh to pass-thru perf.php arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorfox committed May 21, 2018
1 parent eac518d commit 3e48c29
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 4 additions & 0 deletions benchpress/jobs/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,7 @@
- '-rhhvm'
- '-n./benchmarks/nginx/sbin/nginx'
- '-s./benchmarks/siege/bin/siege'
- '--'
- '--mediawiki'
- '--siege-duration 10M'
- '--siege-timeout 11m'
19 changes: 14 additions & 5 deletions benchpress/templates/oss-performance/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ declare -r OLD_CWD="$( pwd )"

function show_help() {
cat <<EOF
Usage: ${0##*/} [-h] [-H db host] [-r hhvm path] [-n nginx path] [-s siege path]
Usage: ${0##*/} [-h] [-H db host] [-r hhvm path] [-n nginx path] [-s siege path] [-- extra_args]
Proxy shell script to executes oss-performance benchmark
-h display this help and exit
-H hostname or IP address to mariadb or mysql database
-n path to nginx binary (default: 'nginx')
-r path to hhvm binary (default: 'hhvm')
-s path to siege binary (default: 'siege')
Any other options that oss-performance perf.php script could accept can be
passed in as extra argunts appending two hyphens '--' followed by the
arguments. Example:
${0##*/} -- --mediawiki --siege-duration 10M --exec-after-benchmark time
EOF
}

Expand Down Expand Up @@ -55,9 +62,8 @@ function run_benchmark() {
--nginx "$_nginx_path" \
--siege "$_siege_path" \
--hhvm "$_hhvm_path" \
--mediawiki \
--db-username root \
--db-password ''
${_db_host} \
${extra_args}
cd "${OLD_CWD}"
}

Expand Down Expand Up @@ -106,6 +112,9 @@ function main() {
done
shift "$(($OPTIND -1))"

# Extra arguments to pass to perf.php
extra_args=$@

readonly db_host
readonly hhvm_path
readonly nginx_path
Expand All @@ -115,7 +124,7 @@ function main() {
_check_local_db_running || return
run_benchmark ${hhvm_path} ${nginx_path} ${siege_path}
else
run_benchmark ${hhvm_path} ${nginx_path} ${siege_path} $db_host
run_benchmark ${hhvm_path} ${nginx_path} ${siege_path} ${db_host}
fi

exit 0
Expand Down

0 comments on commit 3e48c29

Please sign in to comment.