summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-02-20 13:23:01 +1100
committerAndrew Tridgell <tridge@samba.org>2007-02-20 13:23:01 +1100
commit8be5bdd671b16216294f9aa5e7309e2bb46ffdb2 (patch)
treeba07f10f3d3b92db54f0348343d9caf565b69bdb
parented6d9d060612a58be6310b981c5bf2dd462e938e (diff)
added a benchmark script that launches via ssh
(This used to be ctdb commit 7eeeb9c1d8f82739015ce78d8c90291baf3b1982)
-rwxr-xr-xctdb/tests/bench-ssh.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/ctdb/tests/bench-ssh.sh b/ctdb/tests/bench-ssh.sh
new file mode 100755
index 0000000000..0d11ee9cdd
--- /dev/null
+++ b/ctdb/tests/bench-ssh.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+if [ $# -lt 1 ]; then
+ echo "Usage: bench-ssh.sh <NODES> <OPTIONS>"
+ exit 1
+fi
+
+while :; do
+ if [ "`echo $1 | cut -c1`" = "-" -o $# -eq 0 ]; then break; fi
+ nodes="$nodes $1";
+ shift;
+done
+
+options=$*
+dir=`pwd`
+
+echo "Creating nodes-ssh.txt"
+rm -f nodes-ssh.txt
+count=0
+for h in $nodes; do
+ echo "$h:9001" >> nodes-ssh.txt
+ count=`expr $count + 1`
+done
+
+
+echo "Killing old processes"
+for h in $nodes; do
+ scp -q nodes-ssh.txt $h:$dir
+ ssh $h killall -q ctdb_bench
+done
+
+echo "Starting nodes"
+i=0
+for h in $nodes; do
+ if [ $i -eq `expr $count - 1` ]; then
+ ssh $h $dir/bin/ctdb_bench --nlist $dir/nodes-ssh.txt --listen $h:9001 $options
+ else
+ ssh -f $h $dir/bin/ctdb_bench --nlist $dir/nodes-ssh.txt --listen $h:9001 $options
+ fi
+ i=`expr $i + 1`
+done
+
+wait