]> Untitled Git - lemmy.git/commitdiff
Add apache benchmark installation check
authorcharleshthomasiii <charlie.h.thomas@gmail.com>
Wed, 15 Apr 2020 17:52:46 +0000 (13:52 -0400)
committercharleshthomasiii <charlie.h.thomas@gmail.com>
Wed, 15 Apr 2020 17:52:46 +0000 (13:52 -0400)
server/query_testing/apache_bench_report.sh
server/query_testing/api_benchmark.sh

index 62b3e86368f584aa187357f84e14c5f15b0dd096..06ceb48438aba369acd015068cebfab193d0ab5c 100755 (executable)
@@ -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
index 8f8c65f1cd96433d022314fd7ba3060e64602b85..9f06580a76c14e280e84b49e338d9ce4b17233d8 100755 (executable)
@@ -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