JMeter parametric section refer to previous article
Shell parameter Description: Number of threads, $: Total concurrency Rampup time, $ $: script run time, $4: Each script cycle duration $: So the cycle duration
#!/bin/bash
Report_time= ' Date ' +%y%m%d%h%m%s '
jmeter_basedir=/users/lyh/desktop/dubbo-performance-testing/apache-jmeter-2.13
report_icon= $jmeter _basedir/extras/collapse.png
Workspace=/users/lyh/desktop/script
Report_jtl= $WORKSPACE/REPORT/JTL
Report_html= $WORKSPACE/report/html
echo "Starting ..."
Cd/users/lyh/desktop/script
For v1 in $ (LS *.jmx)
Do
# report_time= ' Date ' +%y%m%d%h%m%s '
# testreport= ' ls $v 1|sed ' s/.jmx//g '
# echo $TestReport
CD $jmeter _basedir/bin
SH jmeter.sh-jthreadcount=$1-jrampup=$2-jdurationtime=$3-n-t/users/lyh/desktop/script/$v 1-l $report _jtl/ TESTREPORT_$REPORT_TIME.JTL &
# >~/logs.log &
# Xsltproc $jmeter _basedir/extras/jmeter-results-detail-report_21.xsl $report _jtl/testreport_$report_time.jtl > $report _html/testreport_$report_time.html
# sed-i "S/date not defined/$REPORT _time/g" grep "date not defined"-l $report _html/testreport_$report_time.html
# if [!-F "$report _icon"];then
# CP $jmeter _basedir/extras/collapse.png $jmeter _basedir/extras/expand.png $report _html
# fi
# if [!-d "$report _jtl"];then
# CD $WORKSPACE/report && mkdir JTL
# fi
Sleep $4
#for ID in $ (ps-ef|grep jmeter|grep-v Grep|awk ' {print $} ')
#do
#echo $id
#kill-9 $id
#done
#sleep 5
Done &
Sleep
Xsltproc $jmeter _basedir/extras/jmeter-results-detail-report_21.xsl $report _jtl/testreport_$report_time.jtl > $ Report_html/testreport_$report_time.html &
Sleep 30
For ID1 in $ (ps-ef|grep Jmeter|awk ' {print $} ')
Do
echo $id 1
Kill-9 $id 1
Done
echo "Ending ..."
Run command: SH shell file name. SH $ $4
Sh-x Shell 3 1 30 40 140
Operation Result:
Open the HTML results file in Tomcat as follows:
Shell external incoming JMeter script thread count, rampup time, continuous run time