diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2009-06-22 16:00:02 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2009-06-22 16:00:02 +0000 |
| commit | b554e1810dfa7652bb5c5b59173874c13f1a8ffe (patch) | |
| tree | 77238b3e3acc3fde846e04932d66f226aaaedcb2 /java/perftests/bin/monitoring/runTests.sh | |
| parent | bb79c97b98e762a6b236bfb370377ba6e2c18689 (diff) | |
| download | qpid-python-b554e1810dfa7652bb5c5b59173874c13f1a8ffe.tar.gz | |
Qpid-1934 : Add start/stop script for broker monitoring.
Add runTest.sh that starts a given set of tests and then generates stat files for them
Updated monitor-broker to use $! to get top pid, rather than ps|grep
made runTests.sh take a file which contains a list of tests to run.
Addition of processTests:
Creates a Result Package suitable for processing by process.sh / processAll.sh
Updated process.sh to correctly handle new broker_cpu.log date format and to have better error handling when there is no GC data
Update to monitor-broker to record the top rate so it can be used in processing
Update to process.sh to better display the CPU x axis using the time.
Update to processTests.py to use a regex to extract the GC time stamp.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@787292 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/perftests/bin/monitoring/runTests.sh')
| -rwxr-xr-x | java/perftests/bin/monitoring/runTests.sh | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/java/perftests/bin/monitoring/runTests.sh b/java/perftests/bin/monitoring/runTests.sh new file mode 100755 index 0000000000..4ba5040ccc --- /dev/null +++ b/java/perftests/bin/monitoring/runTests.sh @@ -0,0 +1,127 @@ +#!/bin/bash +# +# Run specified performance tests and +# gather details about the test run +# + + +runTest() +{ + echo "$@" + echo "$@ --csv -o $LOG_DIR" >> $LOG_DIR/TestRun.log 2>&1 + ./$@ --csv -o $LOG_DIR >> $LOG_DIR/TestRun.log 2>&1 +} + +showUsageExit() +{ + echo "Usage $0 <Path to Test Pack> <LOG DIR> <TEST LIST FILE>" + exit 1 +} + +# Ensure we have minimum of three arguments +if [[ $# > 2 ]] ; then + TEST_VERSION=$1 + LOG_DIR=$2 + TEST_LIST=$3 + # Remove these arguments from the $@ variable + shift + shift + shift +else + showUsageExit +fi + +# +# Check the specified broker is reachable +# it it is not the log and show usage +# +if [ ! -d $TEST_VERSION ] ; then + echo "Tests not available at: $TEST_VERSION" + showUsageExit +fi + + +# +# Check to see if we have an absolute path for logging +# +logStart=`echo $LOG_DIR|cut -c 1` + +# +# If we don't have an absolute path then add the current +# directory path to the start. +# +if [[ $logStart != '/' ]] ; then + echo -n "$LOG_DIR is not absolute, using " + LOG_DIR=`pwd`/$LOG_DIR + echo $LOG_DIR +fi + +# +# Validate that the directory does not exist +# - this is so we can guarrantee a clean run. +# If it does exit then log and show usage +# +if [ -d $LOG_DIR ] ; then + echo "Log directory already exists : $LOG_DIR" + showUsageExit +fi + +# +# Check to see if we have an absolute path for test list +# +testListStart=`echo $TEST_LIST|cut -c 1` + +# +# If we don't have an absolute path then add the current +# directory path to the start. +# +if [[ $testListStart != '/' ]] ; then + echo -n "$TEST_LIST is not absolute, using " + TEST_LIST=`pwd`/$TEST_LIST + echo $TEST_LIST +fi + +# +# Validate that the directory does not exist +# - this is so we can guarrantee a clean run. +# If it does exit then log and show usage +# +# -r Check file exists and is readable +if [ ! -r $TEST_LIST ] ; then + echo "Test file is not readable : $TEST_LIST" + showUsageExit +fi + + + +# +# Create the logging directory +# +mkdir -p $LOG_DIR + + + +echo "Starting Test Run in : $TEST_VERSION" +pushd $TEST_VERSION/bin > /dev/null + +# +# Run tests +# + + +while read testCommand +do + runTest $testCommand +done < "$TEST_LIST" + + +popd > /dev/null + + +# +# Generate Stat files +# +echo "Generating Stat data" +for file in `find $LOG_DIR -name "*.csv"` ; do + stat $file > $file.stat +done |
