Skip to content

Instantly share code, notes, and snippets.

@netmarkjp
Last active August 29, 2015 14:00
Show Gist options
  • Save netmarkjp/11185290 to your computer and use it in GitHub Desktop.
Save netmarkjp/11185290 to your computer and use it in GitHub Desktop.
#!/bin/bash
## Usage:
## sudo bash run_jmeter.sh test.jmx
JMETER="`dirname $0`/apache-jmeter-2.11/bin/jmeter"
NOW=$(date +%Y%m%d_%H%M)
export JVM_ARGS="-Xloggc:${NOW}/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled"
ulimit -n 65535
mkdir ${NOW}
cp $1 ${NOW}/.
echo ${JMETER:?} -n -t $1 -l ${NOW}/output.csv 2>&1 | tee -a ${NOW}/jmeter.log >> ${NOW}/cmd.txt
${JMETER:?} -n -t $1 -l ${NOW}/output.csv 2>&1 | tee -a ${NOW}/jmeter.log
mv result_*.csv ${NOW}/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment