Jmeter (forty) - From entry to advanced level - A thorough understanding of Jmeter configuration files - Part 2 (detailed tutorial)

1 Introduction

Why do we need to explain the configuration file of Jmeter? Because some children or friends encounter some problems that require modifying the configuration file during testing. They are not very clear or understand it. Even if they are modified, it is still vague. What's more, some people think that it is a sacred place and cannot be violated lightly. They dare not touch it and do not modify it. They are afraid that if they modify it wrongly, Jmeter will not be able to run. After listening to Brother Hong's bold modification, you will not have to reinstall a new Jmeter. Or if you have a good habit of making backups, make bold modifications after backing up before modification. If you make a mistake, you can just use the backup file to restore it.

2. Configuration file

Enter: properties in the search box under the %JMETER_HOME%\bin (or $JMETER_HOME/bin) directory and you  will find that there are multiple configuration files, as shown in the following figure:

If you want to learn automated testing, I recommend a set of videos to you. This video can be said to be the number one automated testing tutorial on the entire network played by Bilibili. The number of people online at the same time has reached 1,000, and there are also notes that can be collected and communicated with various channels. Master technical communication: 798478386    

[Updated] A complete collection of the most detailed practical tutorials on Python interface automation testing taught by Bilibili (the latest practical version)_bilibili_bilibili [Updated] A complete collection of the most detailed practical tutorials on Python interface automated testing taught by Bilibili (practical version) The latest version) has a total of 200 videos, including: 1. Why interface automation should be done for interface automation, 2. Overall view of request for interface automation, 3. Interface practice for interface automation, etc. For more exciting videos from UP master, please follow the UP account . icon-default.png?t=N7T8https://www.bilibili.com/video/BV17p4y1B77x/?spm_id_from=333.337

 

In the previous article, the most important one is jmeter.properties. It is the Jmeter core configuration item file and was explained and explained. The following is a summary and explanation of the settings of some other commonly used configuration files. It is planned that Brother Hong will explain it today. user.properties file.

3.user.properties

This file is not very big. Brother Hong has translated all its contents. Let’s take a look at what configuration items it contains.

3.1 Document Description

Paragraph 1 – License Description

(1) Original text

# Sample user.properties file
#
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
## 
## http://www.apache.org/licenses/LICENSE-2.0
## 
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.

 (2) Translation

# 示例user.properties文件
#
## Apache软件基金会(ASF)下一个或多个许可
## 贡献者许可协议。请参阅
## 此作品用于获取关于版权所有权的附加信息。
## ASF根据Apache 2.0 版本许可证协议将此文件授权给您。
## (“许可证”);除非符合以下条件,否则不能使用此文件
## 许可证。您可以在
## 
## http://www.apache.org/licenses/LICENSE-2.0
## 
## 除非适用法律要求或书面同意,软件
## 根据在“AS IS”BASIS上分发的许可证基础上发布的,
## 无任何明示或暗示的保证或条件。
## 有关管理权限的特定语言,请参阅许可证
## 《许可证》规定的限制。
3.2 Class path configuration

(1) Paragraph 2 - List of paths used to search for other JMeter plug-in classes

(1) Original text

#---------------------------------------------------------------------------
# Classpath configuration
#---------------------------------------------------------------------------
#
# List of paths (separated by ;) to search for additional JMeter plugin classes,
# for example new GUI elements and samplers.
# A path item can either be a jar file or a directory.
# Any jar file in such a directory will be automatically included,
# jar files in sub directories are ignored.
# The given value is in addition to any jars found in the lib/ext directory.
# Do not use this for utility or plugin dependency jars.
#search_paths=/app1/lib;/app2/lib

 (2) Translation


#---------------------------------------------------------------------------
# 类路径配置
#---------------------------------------------------------------------------
#
# 用于搜索其他JMeter插件类的路径列表(由;分隔),
# 例如,新的GUI元素和采样器。
# 路径项可以是jar文件或目录。
# 这样的目录中的任何jar文件都将自动包含,
# 忽略子目录中的jar文件。
# 给定值是在lib/ext目录中找到的任何jar之外的值。
# 不要将此用于实用程序或插件依赖项jar。
#search_paths=/app1/lib;/app2/lib

(2) Paragraph 3 - Search path list for utility and plug-in dependent classes

(1) Original text

 

# List of paths that JMeter will search for utility and plugin dependency classes.
# Use your platform path separator (java.io.File.pathSeparatorChar in Java) to separate multiple paths.
# A path item can either be a jar file or a directory.
# Any jar file in such a directory will be automatically included,
# jar files in sub directories are ignored.
# The given value is in addition to any jars found in the lib directory.
# All entries will be added to the class path of the system class loader
# and also to the path of the JMeter internal loader.
# Paths with spaces may cause problems for the JVM
#Example for windows (; separator)
#user.classpath=../classes;../lib;../app1/jar1.jar;../app2/jar2.jar
#Example for linux (:separator)
#user.classpath=../classes:../lib:../app1/jar1.jar:../app2/jar2.jar

(2) Translation

# JMeter将搜索实用程序和插件依赖类的路径列表。
# 使用您的平台路径分隔符(Java中的java. Io.Fiel.PosialStutoRealar)来分离多条路径。
# 路径项可以是jar文件或目录。
# 这样的目录中的任何jar文件都将自动包含,
# 忽略子目录中的jar文件。
# 给定的值是在lib目录中找到的任何jar之外的值。
# 所有条目都将添加到系统类加载器的类路径
# 以及JMeter内部加载程序的路径。
# 带有空间的路径可能导致JVM的问题
#示例 Windows(分离器)
#user.classpath=../classes;../lib;../app1/jar1.jar;../app2/jar2.jar
#示例 linux (分离器)
#user.classpath=../classes:../lib:../app1/jar1.jar:../app2/jar2.jar

(3) Paragraph 4 - Path list for search utility

(1) Original text

# List of paths (separated by ;) that JMeter will search for utility
# and plugin dependency classes.
# A path item can either be a jar file or a directory.
# Any jar file in such a directory will be automatically included,
# jar files in sub directories are ignored.
# The given value is in addition to any jars found in the lib directory
# or given by the user.classpath property.
# All entries will be added to the path of the JMeter internal loader only.
# For plugin dependencies using plugin_dependency_paths should be preferred over
# user.classpath.
#plugin_dependency_paths=../dependencies/lib;../app1/jar1.jar;../app2/jar2.jar

 (2) Translation

# JMeter将搜索实用程序的路径列表(由;分隔)
# 以及插件依赖类。
# 路径项可以是jar文件或目录。
# 这样的目录中的任何jar文件都将自动包含,
# 忽略子目录中的jar文件。
# 给定值是在lib目录中找到的任何jar之外的值
# 或者由user.classpath属性给出。
# 所有条目将仅添加到JMeter内部加载程序的路径。
# 对于插件依赖关系,应该优先使用 plugin_dependency_paths
# user.classpath.
#plugin_dependency_paths=../dependencies/lib;../app1/jar1.jar;../app2/jar2.jar
3.3 Report configuration

(1) Paragraph 5 - Title

(1) Original text

#---------------------------------------------------------------------------
# Reporting configuration
#---------------------------------------------------------------------------

 (2) Translation


#---------------------------------------------------------------------------
# 报告配置
#---------------------------------------------------------------------------

(2) Paragraph 6 - Change the report title

(1) Original text

# Configure this property to change the report title
#jmeter.reportgenerator.report_title=Apache JMeter Dashboard

 (2) Translation

# 配置此属性以更改报表标题
#jmeter.reportgenerator.report_title=Apache JMeter Dashboard

(3) Paragraph 7 - Generate report based on date range

(1) Original text

# Used to generate a report based on a date range if needed
# Default date format (from SimpleDateFormat Java API and Locale.ENGLISH)
#jmeter.reportgenerator.date_format=yyyyMMddHHmmss
# Date range start date using date_format property
#jmeter.reportgenerator.start_date=
# Date range end date using date_format property
#jmeter.reportgenerator.end_date=

(2) Translation

# 如果需要,可用于根据日期范围生成报告
# 默认日期格式 (来自 Java API 和 Locale.ENGLISH 的日期格式)
#jmeter.reportgenerator.date_format=yyyyMMddHHmmss
# 日期范围开始日期使用 date_format 属性
#jmeter.reportgenerator.start_date=
# 日期范围结束日期使用 date_format 属性
#jmeter.reportgenerator.end_date=

 (4) Paragraph 8 - Changing the granularity of the graph over time

(1) Original text

# Change this parameter if you want to change the granularity of over time graphs.
#jmeter.reportgenerator.overall_granularity=60000

(2) Translation

# 如果希望更改随时间变化的图的粒度,请更改此参数。
#jmeter.reportgenerator.overall_granularity=60000

 (5) Paragraph 9 - Changing the granularity of response time distribution

(1) Original text

# Change this parameter if you want to change the granularity of Response time distribution
# Set to 100 ms by default
#jmeter.reportgenerator.graph.responseTimeDistribution.property.set_granularity=100

(2) Translation

# 如果希望更改响应时间分布的粒度,请更改此参数
# 默认设置为100ms
#jmeter.reportgenerator.graph.responseTimeDistribution.property.set_granularity=100

 (6) Paragraph 10 - Instructions on which samples to retain for graphical and statistical generation

(1) Original text

# Change this parameter if you want to keep only some samples.
# Regular Expression which Indicates which samples to keep for graphs and statistics generation.
# Empty value means no filtering
#jmeter.reportgenerator.sample_filter=

(2) Translation 

# 如果仅希望保留一些示例,请更改此参数。
# 正则表达式,它指示为图形和统计生成保留哪些样本。
# 空值意味着没有过滤
#jmeter.reportgenerator.sample_filter=

(7) Paragraph 11 - Modify the APDEX satisfaction threshold

(1) Original text

# Change this parameter if you want to override the APDEX satisfaction threshold.
#jmeter.reportgenerator.apdex_satisfied_threshold=500

 (2) Translation

# 如果要修改APDEX满意度阈值,请更改此参数。
#jmeter.reportgenerator.apdex_satisfied_threshold=500

(8) Paragraph 12 - Modify the APDEX tolerance threshold

(1) Original text

# Change this parameter if you want to override the APDEX tolerance threshold.
#jmeter.reportgenerator.apdex_tolerated_threshold=1500

 (2) Translation

# 如果要修改APDEX容忍阈值,请更改此参数。
#jmeter.reportgenerator.apdex_tolerated_threshold=1500

(9) Paragraph 13 - Graphic series indicating filtering (regular expression)

(1) Original text

# Indicates which graph series are filtered (regular expression)
# In the below example we filter on Search and Order samples
# Note that the end of the pattern should always include (-success|-failure)?$
# TransactionsPerSecondGraphConsumer suffixes transactions with "-success" or "-failure" depending 
# on the result
#jmeter.reportgenerator.exporter.html.series_filter=^(Search|Order)(-success|-failure)?$

 (2) Translation

# 指示筛选的图形系列(正则表达式)
# 在下面的示例中,在下面的示例中,我们对搜索和订单样本进行过滤(您只能修改搜索|订单字段值,保留其余部分,以便在您不想要所有内容时仅保留报表中所需的事务)。
# 注意,模式的结尾应该始终包括 (-success|-failure)?$
# Transactions每秒后缀使用“-success”或“-failure”的事务,取决于
# 结果的
#jmeter.reportgenerator.exporter.html.series_filter=^(搜索|订单)(-success|-failure)?$

(10) Paragraph 14 - Indicates whether to display controller examples only on graphics that support that controller

(1) Original text

# Indicates whether only controller samples are displayed on graphs that support it.
#jmeter.reportgenerator.exporter.html.show_controllers_only=false

 (2) Translation

# 指示是否仅在支持该控制器的图形上显示控制器示例。
#jmeter.reportgenerator.exporter.html.show_controllers_only=false

(11) Paragraph 15 - Select which transactions will be exported by default

(1) Original text

# This property is used by menu item "Export transactions for report"
# It is used to select which transactions by default will be exported
#jmeter.reportgenerator.exported_transactions_pattern=[a-zA-Z0-9_\\-{}\\$\\.]*[-_][0-9]*

 (2) Translation

# 此属性用于菜单项“导出事务报告”
# 它用于选择默认情况下将导出哪些事务
#jmeter.reportgenerator.exported_transactions_pattern=[a-zA-Z0-9_\\-{}\\$\\.]*[-_][0-9]*

(12) Paragraph 16 - Custom graphics definition

(1) Original text

## Custom graph definition
#jmeter.reportgenerator.graph.custom_mm_hit.classname=org.apache.jmeter.report.processor.graph.impl.CustomGraphConsumer
#jmeter.reportgenerator.graph.custom_mm_hit.title=Graph Title
#jmeter.reportgenerator.graph.custom_mm_hit.property.set_Y_Axis=Response Time (ms)
#jmeter.reportgenerator.graph.custom_mm_hit.property.set_X_Axis=Over Time
#jmeter.reportgenerator.graph.custom_mm_hit.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
#jmeter.reportgenerator.graph.custom_mm_hit.property.setSampleVariableName=VarName
#jmeter.reportgenerator.graph.custom_mm_hit.property.setContentMessage=Message for graph point label

 (2) Translation

## 自定义图形定义
#jmeter.reportgenerator.graph.custom_mm_hit.classname=org.apache.jmeter.report.processor.graph.impl.CustomGraphConsumer
#jmeter.reportgenerator.graph.custom_mm_hit.title=Graph Title
#jmeter.reportgenerator.graph.custom_mm_hit.property.set_Y_Axis=Response Time (ms)
#jmeter.reportgenerator.graph.custom_mm_hit.property.set_X_Axis=Over Time
#jmeter.reportgenerator.graph.custom_mm_hit.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
#jmeter.reportgenerator.graph.custom_mm_hit.property.setSampleVariableName=VarName
#jmeter.reportgenerator.graph.custom_mm_hit.property.setContentMessage=Message for graph point label
3.4 Distributed test configuration

Paragraph 17 – Distributed Test Configuration

(1) Original text


########################################################################
################## DISTRIBUTED TESTING CONFIGURATION ##################
########################################################################
# Type of keystore : JKS
#
#server.rmi.ssl.keystore.type=JKS
#
# Keystore file that contains private key
#
#server.rmi.ssl.keystore.file=rmi_keystore.jks
#
# Password of Keystore
#
#server.rmi.ssl.keystore.password=changeit
#
# Key alias
#
#server.rmi.ssl.keystore.alias=rmi
#
# Type of truststore : JKS
#
#server.rmi.ssl.truststore.type=JKS
#
# Keystore file that contains certificate
#
#server.rmi.ssl.truststore.file=rmi_keystore.jks
#
# Password of Trust store
#
#server.rmi.ssl.truststore.password=changeit
#
# Set this if you don't want to use SSL for RMI
#
#server.rmi.ssl.disable=false

 (2) Translation


########################################################################
################## 分布式测试配置 ##################
########################################################################
# 密钥库类型:JKS
#
#server.rmi.ssl.keystore.type=JKS
#
# 包含私钥的密钥文件
#
#server.rmi.ssl.keystore.file=rmi_keystore.jks
#
# 键盘密码
#
#server.rmi.ssl.keystore.password=changeit
#
# 密钥别名
#
#server.rmi.ssl.keystore.alias=rmi
#
# 信任库类型:JKS
#
#server.rmi.ssl.truststore.type=JKS
#
# 包含证书的密钥文件
#
#server.rmi.ssl.truststore.file=rmi_keystore.jks
#
# 信任存储区密码
#
#server.rmi.ssl.truststore.password=changeit
#
# 如果不想为RMI使用SSL,请设置此设置
#
#server.rmi.ssl.disable=false

 4. Summary

 In the previous article, we explained the official recommendation for modifying the jmeter.properties file: copy and paste the property values ​​that need to be modified to user.properties in the same directory. Why should the property values ​​​​that were originally modified in jmeter.properties be copied to the user.properties file? It still works, and the reason is as shown in the figure below:

  From the picture above, we can see that when Jmeter starts reading the jmeter.properties file, it will also automatically load the user.properties file. Therefore, the property values ​​modified in jmeter.properties can still work when copied to the user.properties file.

Guess you like

Origin blog.csdn.net/Faith_Lzt/article/details/132833377