Return-Path: Delivered-To: apmail-incubator-qpid-commits-archive@locus.apache.org Received: (qmail 41729 invoked from network); 28 Nov 2007 15:35:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Nov 2007 15:35:26 -0000 Received: (qmail 98789 invoked by uid 500); 28 Nov 2007 15:35:14 -0000 Delivered-To: apmail-incubator-qpid-commits-archive@incubator.apache.org Received: (qmail 98767 invoked by uid 500); 28 Nov 2007 15:35:14 -0000 Mailing-List: contact qpid-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: qpid-dev@incubator.apache.org Delivered-To: mailing list qpid-commits@incubator.apache.org Received: (qmail 98757 invoked by uid 99); 28 Nov 2007 15:35:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Nov 2007 07:35:14 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Nov 2007 15:35:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0081B1A9832; Wed, 28 Nov 2007 07:35:04 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r599028 - /incubator/qpid/trunk/qpid/cpp/src/tests/perfdist Date: Wed, 28 Nov 2007 15:35:04 -0000 To: qpid-commits@incubator.apache.org From: aconway@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071128153505.0081B1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: aconway Date: Wed Nov 28 07:35:03 2007 New Revision: 599028 URL: http://svn.apache.org/viewvc?rev=599028&view=rev Log: src/tests/perfdist: Updated for changes to perftest. Modified: incubator/qpid/trunk/qpid/cpp/src/tests/perfdist Modified: incubator/qpid/trunk/qpid/cpp/src/tests/perfdist URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/perfdist?rev=599028&r1=599027&r2=599028&view=diff ============================================================================== --- incubator/qpid/trunk/qpid/cpp/src/tests/perfdist (original) +++ incubator/qpid/trunk/qpid/cpp/src/tests/perfdist Wed Nov 28 07:35:03 2007 @@ -1,32 +1,56 @@ #!/bin/bash # +set -e usage() { cat < --pubhosts --subhosts + +All perftest args must come before --pubhost or --subhost. Runs one +publish process on each publish-host, one subscribe process on each +subscribe-host. To run multiple processes on the same host, list it +more than once. + +Do not pass action flags --setup, --control, --publish, --subscribe they +will be passed to the appropriate processes. + +Do not pass --nsubs or --npubs, they are calculated by counting the host lists. EOF exit 1 } -while test "$HOSTS" != "$*"; do +while test $# -gt 0; do case $1 in - --consumers|--publish|--listen) usage ;; - --) shift; PUB="$1" ; shift ; HOSTS="$*" ;; + --publish|--subscribe|--setup|--control|--npubs|--nsubs) usage ;; + --pubhosts) COLLECT=PUBHOSTS; shift; break ;; + --subhosts) COLLECT=SUBHOSTS; shift; break ;; *) ARGS="$ARGS $1"; shift ;; esac done -test -n "$HOSTS" || { echo "No -- found"; usage; } -N=`echo $HOSTS | wc -w` -PERFTEST=`PATH=$PWD:$PATH which perftest` -$PERFTEST --purge $ARGS -ssh $PUB $PERFTEST $ARGS --publish --consumers $N& -for h in $HOSTS; do - ssh $h $PERFTEST $ARGS --listen& + +if [ -z "$COLLECT" ]; then echo "No --pubhost or --subhost specified"; usage; fi + +while test $# -gt 0; do + case $1 in + --pubhosts) COLLECT=PUBHOSTS; shift ;; + --subhosts) COLLECT=SUBHOSTS; shift ;; + *) eval "$COLLECT=\"\$$COLLECT $1\""; shift ;; + esac done -wait +if [ -z "$PUBHOSTS" ]; then echo "Missing --pubhost or --subhost"; usage; fi +if [ -z "$SUBHOSTS" ]; then echo "Missing --subhost or --subhost"; usage; fi + +NPUBS=`echo $PUBHOSTS | wc -w` +NSUBS=`echo $SUBHOSTS | wc -w` +ARGS="$ARGS --npubs $NPUBS --nsubs $NSUBS" +PERFTEST="`PATH=$PWD:$PATH which perftest` $ARGS" + +start() { + echo $1 on $2 + ssh $2 $PERFTEST --$1 +} + +$PERFTEST --setup +for h in $PUBHOSTS; do start publish $h & done +for h in $SUBHOSTS; do start subscribe $h & done +$PERFTEST --control