diff options
author | charleshthomasiii <charlie.h.thomas@gmail.com> | 2020-04-15 13:52:46 -0400 |
---|---|---|
committer | charleshthomasiii <charlie.h.thomas@gmail.com> | 2020-04-15 13:52:46 -0400 |
commit | 09836bffef81df8e703df994d868cb6509be9bb8 (patch) | |
tree | df28b4742907b4ed9e614ad95c27dddc3ee11ad6 /server/query_testing | |
parent | be6a7876b49e8f963506f0b05e12495f119afc10 (diff) |
Add apache benchmark installation check
Diffstat (limited to 'server/query_testing')
-rwxr-xr-x | server/query_testing/apache_bench_report.sh | 6 | ||||
-rwxr-xr-x | server/query_testing/api_benchmark.sh | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/server/query_testing/apache_bench_report.sh b/server/query_testing/apache_bench_report.sh index 62b3e863..06ceb484 100755 --- a/server/query_testing/apache_bench_report.sh +++ b/server/query_testing/apache_bench_report.sh @@ -11,6 +11,12 @@ declare -a arr=( "https://torrents-csv.ml/service/search?q=wheel&page=1&type_=torrent" ) +## check if ab installed +if ! [ -x "$(command -v ab)" ]; then + echo 'Error: ab (Apache Bench) is not installed. https://httpd.apache.org/docs/2.4/programs/ab.html' >&2 + exit 1 +fi + ## now loop through the above array for i in "${arr[@]}" do diff --git a/server/query_testing/api_benchmark.sh b/server/query_testing/api_benchmark.sh index 8f8c65f1..9f06580a 100755 --- a/server/query_testing/api_benchmark.sh +++ b/server/query_testing/api_benchmark.sh @@ -15,6 +15,12 @@ declare -a arr=( "/api/v1/post/list?sort=Hot&type_=All" ) +## check if ab installed +if ! [ -x "$(command -v ab)" ]; then + echo 'Error: ab (Apache Bench) is not installed. https://httpd.apache.org/docs/2.4/programs/ab.html' >&2 + exit 1 +fi + ## now loop through the above array for path in "${arr[@]}" do |