Shell external incoming JMeter script thread count, rampup time, continuous run time

Source: Internet
Author: User
Tags xsl

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.