]> Untitled Git - lemmy.git/blob - query_testing/apache_bench_report.sh
Isomorphic docker (#1124)
[lemmy.git] / query_testing / apache_bench_report.sh
1 #!/bin/bash
2 set -e
3
4 declare -a arr=(
5 "https://mastodon.social/"
6 "https://peertube.social/"
7 "https://dev.lemmy.ml/"
8 "https://dev.lemmy.ml/feeds/all.xml"
9 "https://dev.lemmy.ml/.well-known/nodeinfo"
10 "https://fediverse.blog/.well-known/nodeinfo"
11 "https://torrents-csv.ml/service/search?q=wheel&page=1&type_=torrent"
12 )
13
14 ## check if ab installed
15 if ! [ -x "$(command -v ab)" ]; then
16   echo 'Error: ab (Apache Bench) is not installed. https://httpd.apache.org/docs/2.4/programs/ab.html' >&2
17   exit 1
18 fi
19
20 ## now loop through the above array
21 for i in "${arr[@]}"
22 do
23   ab -c 10 -t 10 "$i" > out.abtest
24   grep "Server Hostname:" out.abtest
25   grep "Document Path:" out.abtest
26   grep "Requests per second" out.abtest
27   grep "(mean, across all concurrent requests)" out.abtest
28   grep "Transfer rate:" out.abtest
29   echo "---"
30 done
31
32 rm *.abtest