Commit 92a30ef1 authored by Kirill Smelkov's avatar Kirill Smelkov

go/neo/t/neotest: Add bench-local and bench-cluster commands

These commands do full benchmarking for localhost and networked cases:

- show system info
- do server & client cpu benchmarks
- do server disk benchmarks
- for networked case: do network benchmarks
- tail to either zbench-local or zbench-cluster

It was full `neotest bench-local` that was used to prepare benchmarks
for http://navytux.spb.ru/~kirr/neo.html and http://navytux.spb.ru/~kirr/misc/neo·P4.html
parent 7385209f
......@@ -1141,6 +1141,17 @@ zbench_go() {
}
# command: benchmark when client and storage are on the same computer
cmd_bench-local() {
echo -e ">>> bench-local"
echo -e "\n*** neotest: node"
system_info
echo -e "\n*** cpu:\n"
bench_cpu
bench_disk
cmd_zbench-local
}
# command: benchmark ZODB client/server over localhost
cmd_zbench-local() {
install_trap
......@@ -1235,6 +1246,33 @@ zbench_local() {
EOF
}
# command: benchmark when server runs locally and client is on another node
cmd_bench-cluster() {
url=$1
test -z "$url" && die "Usage: neotest bench-cluster [user@]<host>:<path>"
echo -e ">>> bench-cluster $url"
echo -e "\n*** neotest: node: (server)"
system_info
echo -e "\n*** neotest: node: (client)"
on $url ./neotest info-local
echo -e "\n*** server cpu:"
bench_cpu
echo -e "\n*** client cpu:"
on $url ./neotest bench-cpu
echo -e "\n*** server disk:"
bench_disk
bench_net $url
# zodb benchmarks
echo
cmd_zbench-cluster $url
}
# command: benchmark ZODB client/server over network
cmd_zbench-cluster() {
url=$1
......@@ -1403,12 +1441,15 @@ The commands are:
test-py run NEO/py unit tests (part of test-local)
bench-cpu benchmark local cpu
bench-disk benchmark local disk
bench-net benchmark network
bench-local run all benchmarks when client and server are both on the same localhost
bench-cluster run all benchmarks when server is local and client is on another node
bench-cpu benchmark local cpu (part of bench-{local,cluster})
bench-disk benchmark local disk (part of bench-{local,cluster})
bench-net benchmark network (part of bench-cluster)
zbench-local run ZODB benchmarks on localhost
zbench-cluster run ZODB benchmarks via network
zbench-local run ZODB benchmarks on localhost (part of bench-local)
zbench-cluster run ZODB benchmarks via network (part of bench-cluster)
zbench-client run ZODB client benchmarks against separate server (part of zbench-cluster)
......@@ -1435,6 +1476,8 @@ test-local) f=(build );;
test-go) f=(build );;
test-py) f=( );;
bench-local) f=(build net fs );;
bench-cluster) f=(build net fs );;
bench-cpu) f=(build );;
bench-disk) f=( fs );;
bench-net) f=( net );;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment