]> Untitled Git - lemmy.git/commitdiff
Adding an apache bench (ab) report.
authorDessalines <tyhou13@gmx.com>
Sun, 12 Jan 2020 18:04:13 +0000 (13:04 -0500)
committerDessalines <tyhou13@gmx.com>
Sun, 12 Jan 2020 18:04:13 +0000 (13:04 -0500)
server/query_testing/apache_bench_report.sh [new file with mode: 0755]
server/query_testing/generate_explain_reports.sh

diff --git a/server/query_testing/apache_bench_report.sh b/server/query_testing/apache_bench_report.sh
new file mode 100755 (executable)
index 0000000..95b9a6c
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+declare -a arr=(
+"https://mastodon.social/"
+"https://peertube.social/"
+"https://dev.lemmy.ml/"
+"https://dev.lemmy.ml/feeds/all.xml"
+"https://dev.lemmy.ml/.well-known/nodeinfo"
+"https://fediverse.blog/.well-known/nodeinfo"
+)
+
+## now loop through the above array
+for i in "${arr[@]}"
+do
+  ab -c 10 -t 10 "$i" > out.abtest
+  grep "Server Hostname:" out.abtest
+  grep "Document Path:" out.abtest
+  grep "Requests per second" out.abtest
+  grep "(mean, across all concurrent requests)" out.abtest
+  grep "Transfer rate:" out.abtest
+  echo "---"
+done
+
+rm *.abtest
index e1a2ff516f62bae78bdc47f4b1fe0bfdb76ae9b8..40b2bceea1eac9be7a7a1feccb8fc7634ea397b9 100755 (executable)
@@ -8,6 +8,9 @@ psql -qAt -U lemmy -f explain.sql > user_view.json
 echo "explain (analyze, format json) select * from post_view where user_id is null order by hot_rank desc" > explain.sql
 psql -qAt -U lemmy -f explain.sql > post_view.json
 
+echo "explain (analyze, format json) select * from post" > explain.sql
+psql -qAt -U lemmy -f explain.sql > post.json
+
 echo "explain (analyze, format json) select * from comment_view where user_id is null" > explain.sql
 psql -qAt -U lemmy -f explain.sql > comment_view.json