当前位置:网站首页>JMeter -- silent operation
JMeter -- silent operation
2022-07-24 18:11:00 【zyanwei2018】
List of articles
Silent piezometry
- The significance of silent pressure measurement
- In the high concurrent pressure test scenario , In order to reduce the influence of pressure measuring tools on the pressure measuring machine , Silence is generally used ( No interface ) Pressure measurement mode
- Silent pressure measurement , You can modify the script , Achieve the effect of automatic pressure measurement
- jmeter Argument parsing
jmeter -n -t *.jmx -l test1.jtl -e -o report1/ -r
Argument parsing :
-n: Not GUI Mode execution Jmeter
-t: The location and file name of the execution test file
-l: Specifies the save file for generating test results ,jtl File format
-j: Specify the log path , If the path does not exist, it will be created automatically
-e: After the test , Generate test reports
-o: Specify the storage location of the test report , And the folder must be empty
-g: Specify the test result file path , Only used to generate test reports , Parameter is csv Results file
-r: Start all at remote_hosts Configured pressure measuring machine
-R: Start at remote_hosts Configured and specified ip Pressure gauge of , grammar : -R IP1,IP2,IP3
- Generate test report according to test results
- The report can be generated directly after the pressure test , A separate report can also be generated based on the pressure test results
# Run silently and generate test results
jmeter -n -t demo.jmx -l td01.jtl
# Generate according to the test results html Test report
mkdir report1 && jmeter -g td01.jtl -o report1
Operation priority
- jmeter Running with
Control the number of cyclesOperation andControl durationfunction 2 Patterns- priority :
Cycle by number > According to the scheduler time > Forever cycle
- After setting the number of times, run according to the number of cycles , Other settings are invalid
- When the number of cycles is not set , After the script is saved, always... Is checked by default , When running, it will continue to run
- When the number of cycles is not set , Check the scheduler , Duration is required , Run continuously at the set time

Parametric operation
- Parameterization
- The number of concurrent is set to
${__P(concurrent_number,1)}, Default 1 Concurrent users- The number of cycles is set to
${__P(cycles,1)}, Default 1 Cycle- The execution time is set to
${__P(duration,60)}, Default 60s- If the number of cycles and the execution time are set at the same time , Number of priority cycles . Therefore, it is necessary to run according to the duration , You need to remove the setting of the number of cycles
- Parametric operation
jmeter -n -t demo1.jmx -Jconcurrent_number=8 -Jduration=60 -Jcycles=2
Automatic operation
- Thread group script

- Parameterized scripts
#! /bin/bash
# The number of concurrency in the pressure test script :thread_num, The pressure measurement time should be 10 second
export jmx_template="demo"
export suffix=".jmx"
export jmx_template_filename="${jmx_template}${suffix}"
export os_type=`uname`
export wait_time=10
# You need to define... In the system variable jmeter The location of the root directory , as follows
export jmeter_path="/Users/whtest/package/apache-jmeter-5.4.3"
echo " Automatic pressure measurement begins "
# List of pressure measurement concurrency
thread_number_array=(10 20 30)
for num in "${thread_number_array[@]}"
do
echo "============================================================"
echo "${num} Thread pressure test starts "
# Generate the jmx file
export jmx_filename="${jmx_template}_${num}${suffix}"
export jtl_filename="test_${num}.jtl"
export web_report_path_name="web_${num}"
rm -f ${jmx_filename} ${jtl_filename}
rm -rf ${web_report_path_name}
cp ${jmx_template_filename} ${jmx_filename}
echo " Generate jmx Pressure test script ${jmx_filename}"
if [[ "${os_type}" == "Darwin" ]]; then
sed -i "" "s/thread_num/${num}/g" ${jmx_filename}
else
sed -i "s/thread_num/${num}/g" ${jmx_filename}
fi
# JMeter Silent piezometry
${jmeter_path}/bin/jmeter -n -t ${jmx_filename} -l ${jtl_filename}
# Generate Web Pressure test report
${jmeter_path}/bin/jmeter -g ${jtl_filename} -e -o ${web_report_path_name}
rm -f ${jmx_filename} ${jtl_filename}
# Wait after the pressure test , Time is set according to specific needs
if [ ${num} -ne 30 ];then
echo "${num} End of thread pressure test , wait for ${wait_time}s"
sleep ${wait_time}
echo "============================================================"
else
echo "${num} End of thread pressure test "
echo "============================================================"
fi
done
echo " The automatic pressure test is all over "
边栏推荐
- 如何向 google colab 快速上传文件
- 简单测试JS代码
- The ability to detect movement in vivo and build a safe and reliable payment level "face brushing" experience
- Goodbye Navicat! This open source database management tool has a cooler interface!
- Definition and storage of adjacency table and adjacency storage of directed graph and undirected graph
- Review and analysis of noodle dishes
- Simple test JS code
- Mac database management software Navicat premium essentials mac
- C language programming training topics: K characters in left-handed string, little Lele and Euclidean, printing arrow pattern, civil servant interview, poplar matrix
- Alibaba /1688 API instructions for searching products by map (pailitao)
猜你喜欢

Get the data of Tongcheng (elong) Hotel

JumpServer的使用
![[OBS] dependency Library: x264 vs Build](/img/24/4caea5dc6ff092a3161f43b6026d25.png)
[OBS] dependency Library: x264 vs Build

Emerging potential of interactive virtual reality technology in drug discovery

手写博客平台~第二天

Go language interface and type

C language custom types - Enumeration

Brats18 - Multimodal MR image brain tumor segmentation challenge continued

Use prometheus+grafana to monitor MySQL performance indicators

C language custom type explanation - structure
随机推荐
T245982 「KDOI-01」醉花阴
Growth of operation and maintenance Xiaobai - week 8 of Architecture
0612~quartz timer frame
pinia 入门及使用
Single cell code analysis - gynecological cancer single cell transcriptome and chromatin accessibility analysis 1
The ability to detect movement in vivo and build a safe and reliable payment level "face brushing" experience
SV casts and constants
字符串常用方法(2)
Inherit, override, overload
Int8 & int8, have you ever stumbled like this?
Blackmagic Fusion Studio 18
去不图床容量兑换
How to read "STL source code analysis"?
单细胞代码解析-妇科癌症单细胞转录组及染色质可及性分析1
redis集群的三种方式
运维小白成长记——架构第8周
Emerging potential of interactive virtual reality technology in drug discovery
File upload vulnerability -.User.ini and.Htaccess
0611~自习课
头文件是必须的吗?跟一跟编译过程~~~