summaryrefslogtreecommitdiff
path: root/java/perftests/bin
diff options
context:
space:
mode:
authorBhupendra Bhusman Bhardwaj <bhupendrab@apache.org>2007-01-12 09:43:09 +0000
committerBhupendra Bhusman Bhardwaj <bhupendrab@apache.org>2007-01-12 09:43:09 +0000
commitd8e6af17a88bbb4dc15b977cac2c7d27fc858e9c (patch)
tree4917820eb309fbe40115598ad3b8a7ab431c5e77 /java/perftests/bin
parent2fc75219859d839bf4962b976fdd3bd14074c6aa (diff)
downloadqpid-python-d8e6af17a88bbb4dc15b977cac2c7d27fc858e9c.tar.gz
Adding a volume test script(volumetestServiceRequestingClient.sh)
This script checks if all the messages were sent received back successfully. ServiceRequestingClient.java and ServiceProvidingClient.java modified to add a message identifier to match the request and response message. log4j file modified to create a log file git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@495532 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/perftests/bin')
-rwxr-xr-xjava/perftests/bin/serviceRequestingClient.sh2
-rwxr-xr-xjava/perftests/bin/volumetestServiceRequestingClient.sh115
2 files changed, 116 insertions, 1 deletions
diff --git a/java/perftests/bin/serviceRequestingClient.sh b/java/perftests/bin/serviceRequestingClient.sh
index 007b927860..4340cefcef 100755
--- a/java/perftests/bin/serviceRequestingClient.sh
+++ b/java/perftests/bin/serviceRequestingClient.sh
@@ -30,4 +30,4 @@ echo $thehosts
# XXX -Xms1024m -XX:NewSize=300m
. ./setupclasspath.sh
echo $CP
-$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn" -Damqj.test.logging.level="info" -Dlog4j.configuration=perftests.log4j org.apache.qpid.requestreply.ServiceRequestingClient $thehosts guest guest /test serviceQ P T "$@"
+$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn" -Dlog.dir="$QPID_HOME/logs" -Damqj.test.logging.level="info" -Dlog4j.configuration=perftests.log4j org.apache.qpid.requestreply.ServiceRequestingClient $thehosts guest guest /test serviceQ P T "$@"
diff --git a/java/perftests/bin/volumetestServiceRequestingClient.sh b/java/perftests/bin/volumetestServiceRequestingClient.sh
new file mode 100755
index 0000000000..28f11ce781
--- /dev/null
+++ b/java/perftests/bin/volumetestServiceRequestingClient.sh
@@ -0,0 +1,115 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+if [[ $# < 3 ]] ; then
+ echo "usage: ./volumetestServiceRequestingClient.sh <brokerdetails> <logfile full path> <number of messages> [<message size 4096b default>]"
+ exit 1
+fi
+
+thehosts=$1
+logname=$2
+messageCount=$3
+messageSize=$4
+
+## create the log dir
+if [ ! -d $QPID_HOME/logs ]; then
+ echo "hello"
+ mkdir $QPID_HOME/logs
+fi
+
+echo "********** Running the test **************"
+echo "..."
+echo
+./serviceRequestingClient.sh $thehosts $messageCount $messageSize
+## check for the status of test execution
+if [ $? -ne 0 ]; then
+ exit 1;
+fi
+
+LOGFILE=$logname
+FILE_SENT=$QPID_HOME/logs/sentMessageItedifiers.txt
+FILE_RECEIVED=$QPID_HOME/logs/receivedMessageItedifiers.txt
+
+echo
+## check if the logfile is present
+if [ ! -f $LOGFILE ]; then
+ echo "logfile $LOGFILE does not exist"
+ echo "please check the logfile path in log4j config file for serviceRequestingClient"
+ exit 1;
+fi
+
+## delete the old files
+if [ -f $FILE_SENT ]; then
+ rm $FILE_SENT
+fi
+
+if [ -f $FILE_RECEIVED ]; then
+ rm $FILE_RECEIVED
+fi
+
+##echo "logfile=$LOGFILE"
+echo "************* Analyzing the log *************"
+echo "..."
+
+n=`wc -l < $LOGFILE`
+i=1
+while [ "$i" -le "$n" ]
+do
+ ## get the sent and received message identifiers
+ line=`cat $LOGFILE | head -$i | tail -1`
+ `echo $line | grep "Sent Message Identifier" |cut -d" " -f4 >> $FILE_SENT`
+ `echo $line | grep "Received Message Identifier" |cut -d" " -f4 >> $FILE_RECEIVED`
+
+ ##show if any exception
+ line=`echo $line | grep "Exception"`
+ if [ `echo $line | wc -w` -gt 0 ]; then
+ echo "Exception occured:"
+ echo $line
+ fi
+
+ i=`expr $i + 1`
+done
+
+
+
+## get the message identifiers, which are sent but not received back
+notReceivedMessageCount=`comm -23 $FILE_SENT $FILE_RECEIVED | wc -l`
+
+echo
+echo "**** Result ****"
+messagesSent=`cat $FILE_SENT | wc -l`
+echo "$messagesSent messages were sent"
+
+if [ $notReceivedMessageCount -gt 0 ];
+then
+ echo "Total $notReceivedMessageCount messages not received back"
+ echo "please check the log $LOGFILE for errors";
+else
+ echo "$messagesSent messages were sent and received back successfully"
+fi
+
+## delete the temp files created
+if [ -f $FILE_SENT ]; then
+ rm $FILE_SENT
+fi
+
+if [ -f $FILE_RECEIVED ]; then
+ rm $FILE_RECEIVED
+fi