Skip to content
Browse files

made loadtest-start and loadtest-stop work properly, added loadtest.s…

…h and loadtest-stop.sh to run/stop server
  • Loading branch information...
1 parent 69d8f05 commit 183faf223a57968cfed70db626b8ea32c94c1cef @throughnothing throughnothing committed Aug 11, 2009
Showing with 119 additions and 4 deletions.
  1. +8 −4 build.xml
  2. +2 −0 loadtest-stop.sh
  3. +109 −0 loadtest.sh
View
12 build.xml
@@ -151,13 +151,13 @@
</target>
<target name="loadtest-start">
- <exec executable="./start.sh" spawn="true"/>
+ <exec executable="./loadtest.sh" spawn="true"/>
<exec executable="sleep">
<arg value="10"/>
</exec>
</target>
- <target name="loadtest-tsung-cached" depends="loadtest-start">
+ <target name="loadtest-tsung-cached" >
<exec executable="utils/tsung_ctl.sh">
<env key="OUTPUT_PREFIX" value="tsung-cached"/>
<env key="TSUNG_LOG" value="tsunglog-cached"/>
@@ -166,7 +166,7 @@
</exec>
</target>
- <target name="loadtest-tsung-notcached" depends="loadtest-start">
+ <target name="loadtest-tsung-notcached" >
<exec executable="utils/tsung_ctl.sh">
<env key="OUTPUT_PREFIX" value="tsung-notcached"/>
<env key="TSUNG_LOG" value="tsunglog-notcached"/>
@@ -175,7 +175,7 @@
</exec>
</target>
- <target name="loadtest-jmeter" depends="loadtest-start">
+ <target name="loadtest-jmeter">
<exec executable="/opt/jmeter/bin/jmeter">
<arg value="-n"/>
<arg line="-t loadtesting/jmeter/basic.jmx"/>
@@ -186,4 +186,8 @@
</exec>
</target>
+ <target name="loadtest-stop">
+ <exec executable="./loadtest-stop.sh"/>
+ </target>
+
</project>
View
2 loadtest-stop.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+kill `cat axiom_stack.pid`
View
109 loadtest.sh
@@ -0,0 +1,109 @@
+#!/usr/bin/env bash
+# Shell script for starting Axiom Stack
+
+# uncomment to set AXIOM_HOME, otherwise we get it from the script path
+# AXIOM_HOME=/usr/local/axiom
+
+# options to pass to the Java virtual machine
+# JAVA_OPTIONS="-server -Xmx128m"
+
+# Set TCP ports for Axiom servers
+# (comment/uncomment to de/activate)
+if [ -z "$HTTP_PORT" ]; then
+ HTTP_PORT=8080
+fi
+# XMLRPC_PORT=8081
+# AJP13_PORT=8009
+# RMI_PORT=5050
+
+# Set file encoding
+ENCODING=UTF-8
+# Set FSDirectory implementation for Lucene
+FSDIRECTORY=org.apache.lucene.store.TransFSDirectory
+
+###########################################################
+###### No user configuration needed below this line #######
+###########################################################
+
+# OS Support
+cygwin=false;
+darwin=false;
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ Darwin*) darwin=true
+ if [ -z "$JAVA_HOME" ] ; then
+ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
+ fi
+ ;;
+esac
+
+if $cygwin; then
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD=`which java 2> /dev/null `
+ if [ -z "$JAVACMD" ] ; then
+ JAVACMD=java
+ fi
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly."
+ echo " We cannot execute $JAVACMD"
+ exit 1
+fi
+
+echo "JAVA=$JAVACMD"
+
+# Get the Axiom installation directory
+INSTALL_DIR="${0%/*}"
+cd $INSTALL_DIR
+INSTALL_DIR=$PWD
+
+# get AXIOM_HOME variable if it isn't set
+if [ -z "$AXIOM_HOME" ]; then
+ # try to get AXIOM_HOME from script file and pwd
+ # strip everyting behind last slash
+ AXIOM_HOME="${0%/*}"
+ cd $AXIOM_HOME
+ AXIOM_HOME=$PWD
+else
+ cd $AXIOM_HOME
+fi
+echo "Starting Axiom in directory $AXIOM_HOME"
+
+if [ "$HTTP_PORT" ]; then
+ SWITCHES="$SWITCHES -w $HTTP_PORT"
+ echo Starting HTTP server on port $HTTP_PORT
+fi
+if [ "$XMLRPC_PORT" ]; then
+ SWITCHES="$SWITCHES -x $XMLRPC_PORT"
+ echo Starting XML-RPC server on port $XMLRPC_PORT
+fi
+if [ "$AJP13_PORT" ]; then
+ SWITCHES="$SWITCHES -jk $AJP13_PORT"
+ echo Starting AJP13 listener on port $AJP13_PORT
+fi
+if [ "$RMI_PORT" ]; then
+ SWITCHES="$SWITCHES -p $RMI_PORT"
+ echo Starting RMI server on port $RMI_PORT
+fi
+if [ "$AXIOM_HOME" ]; then
+ SWITCHES="$SWITCHES -h $AXIOM_HOME"
+fi
+
+# Invoke the Java VM
+$JAVACMD -Dfile.encoding=$ENCODING -Dorg.apache.lucene.FSDirectory.class=$FSDIRECTORY $JAVA_OPTIONS -jar "$INSTALL_DIR/launcher.jar" $SWITCHES > /dev/null 2>&1 &
+JAVA_PID="$!"
+echo $JAVA_PID > axiom_stack.pid

0 comments on commit 183faf2

Please sign in to comment.
Something went wrong with that request. Please try again.