浅谈取样器之调试取样器
JMeter的调试取样器(Debug Sampler)是一个非常实用的工具,它帮助用户在测试计划执行过程中获取详细的内部状态信息,这对于诊断脚本错误、理解变量作用域、以及确认配置是否按预期工作至关重要。调试取样器可以显示JMeter变量、属性以及系统属性的当前值,从而极大地提高了测试脚本开发和维护的效率。
添加调试取样器
要在JMeter测试计划中添加调试取样器,请遵循以下步骤:
- 右键点击你想要添加调试取样器的线程组(Thread Group)或其他合适的容器(如简单控制器(Simple Controller))。
- 选择“添加”(Add) > “取样器”(Sampler) > “调试取样器”(Debug Sampler)。
配置调试取样器
调试取样器界面相对简单,主要包含几个勾选项来控制显示哪些信息:
● JMeter Properties: 如果勾选,将显示所有JMeter属性及其值。这些属性通常由JMeter设置或通过命令行参数定义,全局有效。
● JMeter Variables: 勾选后会列出所有当前线程的局部变量,这些变量对于跟踪用户定义的变量特别有用。
● System Properties: 显示Java系统属性,这些属性提供了有关JVM和操作系统环境的信息。
使用查看结果树
为了观察调试取样器输出的信息,通常会配合使用“查看结果树”(View Results Tree)监听器:
- 在需要观察结果的相同层级下(例如,与调试取样器同一控制器内),右键添加“监听器”(Listener) > “查看结果树”。
- 运行测试计划或线程组,然后在查看结果树中选择调试取样器的结果项,即可看到详细信息。
应用场景
● 变量验证:检查变量是否被正确赋值,特别是在使用了预处理器、函数助手等情况下。
● 属性和环境确认:确保JMeter属性和系统属性符合测试需求。
● 错误排查:当测试脚本执行不当时,快速识别问题所在,比如缺失变量或错误的属性值。
● 逻辑验证:理解脚本执行流程中变量作用域的变化。
最佳实践
● 仅在开发和调试阶段使用:由于查看结果树会消耗较多资源,因此建议仅在开发和调试阶段使用,避免在性能测试中使用以防止影响测试结果的准确性。
● 合理配置输出:根据需要勾选要显示的信息类别,减少不必要的输出,以便更高效地定位问题。
应用实例
使用SpingBoot框架编写如下测试脚本
@PostMapping("/upload")public String uploadFile(@RequestParam("file") MultipartFile file) {try {// 获取上传文件的输入流InputStream inputStream = file.getInputStream();// 使用 InputStreamReader 包装输入流,并指定字符编码(根据实际情况选择适当的编码)InputStreamReader inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);// 使用 BufferedReader 包装 InputStreamReader,以便逐行读取文件内容BufferedReader reader = new BufferedReader(inputStreamReader);// 逐行读取文件内容String line;StringBuilder content = new StringBuilder();while((line = reader.readLine()) != null) {content.append(line);}// 关闭流reader.close();inputStreamReader.close();inputStream.close();// 打印文件内容(也可以根据需要进行其他操作)System.out.println("File content: " + content.toString());return content.toString();} catch (IOException e) {e.printStackTrace();return "Error occurred while uploading file.";}}
我们编写如下测试脚本
线程组:保持默认
HTTP请求:协议http,服务器名称或IP为127.0.0.1,端口号为8091,方法为POST,路径为/upload,内容编码为utf-8,勾选对post使用multipart/form-data,文件上传中文件名称添加文件路径:D:\test.txt,参数类型为file,MIME类型为multipart/form-data,其中test.txt中的文件内容为test upload。
调试取样器:JMeter属性设置为true,JMeter变量设置为true,系统属性设置为true
执行脚本,查看调试取样器中响应数据中的Response Body内容,结果展示如下:
JMeterVariables:
JMeterThread.last_sample_ok=true
JMeterThread.pack=org.apache.jmeter.threads.SamplePackage@6f63c571
START.HMS=090927
START.MS=1721956167203
START.YMD=20240726
TESTSTART.MS=1722237786289
__jm__线程组__idx=0JMeterProperties:
CookieManager.save.cookies=true
HTTPResponse.parsers=htmlParser wmlParser cssParser
START.HMS=090927
START.MS=1721956167203
START.YMD=20240726
TESTSTART.MS=1722237786289
beanshell.server.file=…/extras/startup.bsh
classfinder.functions.contain=.functions.
classfinder.functions.notContain=.gui.
cookies=cookies
cssParser.className=org.apache.jmeter.protocol.http.parser.CssParser
cssParser.types=text/css
gui.quick_0=ThreadGroupGui
gui.quick_1=HttpTestSampleGui
gui.quick_2=RegexExtractorGui
gui.quick_3=AssertionGui
gui.quick_4=ConstantTimerGui
gui.quick_5=TestActionGui
gui.quick_6=JSR223PostProcessor
gui.quick_7=JSR223PreProcessor
gui.quick_8=DebugSampler
gui.quick_9=ViewResultsFullVisualizer
htmlParser.className=org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
htmlParser.types=text/html application/xhtml+xml application/xml text/xml
httpclient4.idletimeout=10000
jdbc.config.check.query=select 1 from INFORMATION_SCHEMA.SYSTEM_USERS|select 1 from dual|select 1 from sysibm.sysdummy1|select 1|select 1 from rdb$database
jdbc.config.jdbc.driver.class=com.mysql.jdbc.Driver|org.postgresql.Driver|oracle.jdbc.OracleDriver|com.ingres.jdbc.IngresDriver|com.microsoft.sqlserver.jdbc.SQLServerDriver|com.microsoft.jdbc.sqlserver.SQLServerDriver|org.apache.derby.jdbc.ClientDriver|org.hsqldb.jdbc.JDBCDriver|com.ibm.db2.jcc.DB2Driver|org.apache.derby.jdbc.ClientDriver|org.h2.Driver|org.firebirdsql.jdbc.FBDriver|org.mariadb.jdbc.Driver|org.sqlite.JDBC|net.sourceforge.jtds.jdbc.Driver
jmeter.reportgenerator.apdex_satisfied_threshold=500
jmeter.reportgenerator.apdex_tolerated_threshold=1500
jmeter.save.saveservice.assertion_results=none
jmeter.save.saveservice.assertion_results_failure_message=true
jmeter.save.saveservice.assertions=true
jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.connect_time=true
jmeter.save.saveservice.data_type=true
jmeter.save.saveservice.encoding=false
jmeter.save.saveservice.filename=false
jmeter.save.saveservice.hostname=false
jmeter.save.saveservice.idle_time=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.requestHeaders=false
jmeter.save.saveservice.responseHeaders=false
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_data=false
jmeter.save.saveservice.response_data.on_error=false
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.sample_count=false
jmeter.save.saveservice.samplerData=false
jmeter.save.saveservice.sent_bytes=true
jmeter.save.saveservice.subresults=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss.SSS
jmeter.save.saveservice.url=true
jmeter.version=5.1.1 r1855137
language=zh_CN
not_in_menu=org.apache.jmeter.protocol.mongodb.sampler.MongoScriptSampler,org.apache.jmeter.protocol.mongodb.config.MongoSourceElement,org.apache.jmeter.timers.BSFTimer,org.apache.jmeter.modifiers.BSFPreProcessor,org.apache.jmeter.extractor.BSFPostProcessor,org.apache.jmeter.assertions.BSFAssertion,org.apache.jmeter.visualizers.BSFListener,org.apache.jmeter.protocol.java.sampler.BSFSampler,org.apache.jmeter.protocol.http.control.gui.SoapSamplerGui
sampleresult.default.encoding=UTF-8
sampleresult.timestamp.start=true
server.rmi.ssl.disable=true
summariser.name=summary
system.properties=system.properties
tcp.handler=BinaryTCPClientImpl
upgrade_properties=/bin/upgrade.properties
user.properties=user.properties
view.results.tree.renderers_order=.RenderAsText,.RenderAsRegexp,.RenderAsBoundaryExtractor,.RenderAsCssJQuery,.RenderAsXPath,org.apache.jmeter.extractor.json.render.RenderAsJsonRenderer,.RenderAsHTML,.RenderAsHTMLFormatted,.RenderAsHTMLWithEmbedded,.RenderAsDocument,.RenderAsJSON,.RenderAsXML
wmlParser.className=org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
wmlParser.types=text/vnd.wap.wmlSystemProperties:
awt.toolkit=sun.awt.windows.WToolkit
file.encoding=GBK
file.encoding.pkg=sun.io
file.separator=
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.awt.printerjob=sun.awt.windows.WPrinterJob
java.class.path=ApacheJMeter.jar;D:\apache-jmeter-5.1.1\lib\accessors-smart-1.2.jar;D:\apache-jmeter-5.1.1\lib\asm-7.0.jar;D:\apache-jmeter-5.1.1\lib\bsf-2.4.0.jar;D:\apache-jmeter-5.1.1\lib\bsh-2.0b6.jar;D:\apache-jmeter-5.1.1\lib\bshclient.jar;D:\apache-jmeter-5.1.1\lib\caffeine-2.6.2.jar;D:\apache-jmeter-5.1.1\lib\cmdrunner-2.2.jar;D:\apache-jmeter-5.1.1\lib\commons-codec-1.10.jar;D:\apache-jmeter-5.1.1\lib\commons-codec-1.11.jar;D:\apache-jmeter-5.1.1\lib\commons-collections-3.2.2.jar;D:\apache-jmeter-5.1.1\lib\commons-dbcp2-2.5.0.jar;D:\apache-jmeter-5.1.1\lib\commons-io-2.6.jar;D:\apache-jmeter-5.1.1\lib\commons-jexl-2.1.1.jar;D:\apache-jmeter-5.1.1\lib\commons-jexl3-3.1.jar;D:\apache-jmeter-5.1.1\lib\commons-lang3-3.8.1.jar;D:\apache-jmeter-5.1.1\lib\commons-math3-3.6.1.jar;D:\apache-jmeter-5.1.1\lib\commons-net-3.6.jar;D:\apache-jmeter-5.1.1\lib\commons-pool2-2.6.0.jar;D:\apache-jmeter-5.1.1\lib\commons-text-1.6.jar;D:\apache-jmeter-5.1.1\lib\darcula.jar;D:\apache-jmeter-5.1.1\lib\dec-0.1.2.jar;D:\apache-jmeter-5.1.1\lib\dnsjava-2.1.8.jar;D:\apache-jmeter-5.1.1\lib\freemarker-2.3.28.jar;D:\apache-jmeter-5.1.1\lib\geronimo-jms_1.1_spec-1.1.1.jar;D:\apache-jmeter-5.1.1\lib\groovy-all-2.4.16.jar;D:\apache-jmeter-5.1.1\lib\hamcrest-core-1.3.jar;D:\apache-jmeter-5.1.1\lib\hamcrest-date-2.0.4.jar;D:\apache-jmeter-5.1.1\lib\httpasyncclient-4.1.4.jar;D:\apache-jmeter-5.1.1\lib\httpclient-4.5.7.jar;D:\apache-jmeter-5.1.1\lib\httpcore-4.4.11.jar;D:\apache-jmeter-5.1.1\lib\httpcore-nio-4.4.11.jar;D:\apache-jmeter-5.1.1\lib\httpmime-4.5.7.jar;D:\apache-jmeter-5.1.1\lib\jackson-annotations-2.9.8.jar;D:\apache-jmeter-5.1.1\lib\jackson-core-2.9.8.jar;D:\apache-jmeter-5.1.1\lib\jackson-databind-2.9.8.jar;D:\apache-jmeter-5.1.1\lib\javax.activation-1.2.0.jar;D:\apache-jmeter-5.1.1\lib\javax.activation-api-1.2.0.jar;D:\apache-jmeter-5.1.1\lib\jcharts-0.7.5.jar;D:\apache-jmeter-5.1.1\lib\jcl-over-slf4j-1.7.25.jar;D:\apache-jmeter-5.1.1\lib\jmeter-plugins-cmn-jmeter-0.3.jar;D:\apache-jmeter-5.1.1\lib\jmeter-plugins-cmn-jmeter-0.6.jar;D:\apache-jmeter-5.1.1\lib\jodd-core-5.0.6.jar;D:\apache-jmeter-5.1.1\lib\jodd-lagarto-5.0.6.jar;D:\apache-jmeter-5.1.1\lib\jodd-log-5.0.6.jar;D:\apache-jmeter-5.1.1\lib\jodd-props-5.0.6.jar;D:\apache-jmeter-5.1.1\lib\jorphan.jar;D:\apache-jmeter-5.1.1\lib\jsch-0.1.50.jar;D:\apache-jmeter-5.1.1\lib\json-path-2.4.0.jar;D:\apache-jmeter-5.1.1\lib\json-smart-2.3.jar;D:\apache-jmeter-5.1.1\lib\jsoup-1.11.3.jar;D:\apache-jmeter-5.1.1\lib\jtidy-r938.jar;D:\apache-jmeter-5.1.1\lib\junit-4.12.jar;D:\apache-jmeter-5.1.1\lib\log4j-1.2-api-2.11.1.jar;D:\apache-jmeter-5.1.1\lib\log4j-api-2.11.1.jar;D:\apache-jmeter-5.1.1\lib\log4j-core-2.11.1.jar;D:\apache-jmeter-5.1.1\lib\log4j-slf4j-impl-2.11.1.jar;D:\apache-jmeter-5.1.1\lib\mail-1.5.0-b01.jar;D:\apache-jmeter-5.1.1\lib\mongo-java-driver-2.11.3.jar;D:\apache-jmeter-5.1.1\lib\oro-2.0.8.jar;D:\apache-jmeter-5.1.1\lib\perfmon-2.2.2.jar;D:\apache-jmeter-5.1.1\lib\ph-commons-9.2.1.jar;D:\apache-jmeter-5.1.1\lib\ph-css-6.1.1.jar;D:\apache-jmeter-5.1.1\lib\rhino-1.7.10.jar;D:\apache-jmeter-5.1.1\lib\rsyntaxtextarea-3.0.2.jar;D:\apache-jmeter-5.1.1\lib\Saxon-HE-9.9.1-1.jar;D:\apache-jmeter-5.1.1\lib\serializer-2.7.2.jar;D:\apache-jmeter-5.1.1\lib\slf4j-api-1.7.26.jar;D:\apache-jmeter-5.1.1\lib\tika-core-1.20.jar;D:\apache-jmeter-5.1.1\lib\tika-parsers-1.20.jar;D:\apache-jmeter-5.1.1\lib\xalan-2.7.2.jar;D:\apache-jmeter-5.1.1\lib\xercesImpl-2.12.0.jar;D:\apache-jmeter-5.1.1\lib\xml-apis-1.4.01.jar;D:\apache-jmeter-5.1.1\lib\xmlgraphics-commons-2.3.jar;D:\apache-jmeter-5.1.1\lib\xmlpull-1.1.3.1.jar;D:\apache-jmeter-5.1.1\lib\xpp3_min-1.1.4c.jar;D:\apache-jmeter-5.1.1\lib\xstream-1.4.11.jar;D:\apache-jmeter-5.1.1\lib\ext\amqp-client-5.7.1.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_components.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_core.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_ftp.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_functions.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_http.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_java.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_jdbc.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_jms.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_junit.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_ldap.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_mail.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_mongodb.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_native.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_ssh-1.1.1-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_ssh-1.2.0.jar;D:\apache-jmeter-5.1.1\lib\ext\ApacheJMeter_tcp.jar;D:\apache-jmeter-5.1.1\lib\ext\Base64ImageFuntions-1.0-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\clocktime-1.0-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\commons-codec-1.10.jar;D:\apache-jmeter-5.1.1\lib\ext\commons-codec-1.2.jar;D:\apache-jmeter-5.1.1\lib\ext\commons-lang3-3.3.2.jar;D:\apache-jmeter-5.1.1\lib\ext\fastjson-1.2.58.jar;D:\apache-jmeter-5.1.1\lib\ext\filearrange.jar;D:\apache-jmeter-5.1.1\lib\ext\GaJmeterPublic-1.0.jar;D:\apache-jmeter-5.1.1\lib\ext\getDevicesInfo.jar;D:\apache-jmeter-5.1.1\lib\ext\GetMACandIP.jar;D:\apache-jmeter-5.1.1\lib\ext\getParamListsUserJackson.jar;D:\apache-jmeter-5.1.1\lib\ext\getParamsUseRegex.jar;D:\apache-jmeter-5.1.1\lib\ext\GetRandomId.jar;D:\apache-jmeter-5.1.1\lib\ext\gettoken.jar;D:\apache-jmeter-5.1.1\lib\ext\hutool-all-5.6.3.jar;D:\apache-jmeter-5.1.1\lib\ext\ImageBase64.jar;D:\apache-jmeter-5.1.1\lib\ext\java_sampler_jmeter.jar;D:\apache-jmeter-5.1.1\lib\ext\javacsv-2.1.jar;D:\apache-jmeter-5.1.1\lib\ext\javarequest.jar;D:\apache-jmeter-5.1.1\lib\ext\javax.mail-1.6.2.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-casutg-2.9.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-cmn-jmeter-0.7.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-common-io-0.2.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-csvars-0.1.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-dummy-0.4.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-ffw-2.0.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-fifo-0.2.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-functions-2.1.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-graphs-basic-2.0.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-graphs-ggl-2.0.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-graphs-vs-2.0.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-manager-1.6.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-perfmon-2.1.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-prmctl-0.3.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-tst-2.5.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-plugins-udp-0.4.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeter-sshmon-1.2.jar;D:\apache-jmeter-5.1.1\lib\ext\jmeterDemo.jar;D:\apache-jmeter-5.1.1\lib\ext\JMeterJavaRequestDemo.jar;D:\apache-jmeter-5.1.1\lib\ext\JMeterPlugins-Standard.jar;D:\apache-jmeter-5.1.1\lib\ext\jsch-0.1.55.jar;D:\apache-jmeter-5.1.1\lib\ext\kafka_jmeter.jar;D:\apache-jmeter-5.1.1\lib\ext\loginTo9Serials-1.0-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\MqSendSampler-1.0-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\mysql-connector-java-5.1.47.jar;D:\apache-jmeter-5.1.1\lib\ext\ojdbc6-11.2.0.3.0.jar;D:\apache-jmeter-5.1.1\lib\ext\paas_auth.jar;D:\apache-jmeter-5.1.1\lib\ext\PaaSAuth.jar;D:\apache-jmeter-5.1.1\lib\ext\postgresql-42.2.9.jar;D:\apache-jmeter-5.1.1\lib\ext\RabbitMQ-0.0.1-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\randomCarPlateFuntion-1.0-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\RandomChineseName-1.0-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\RandomEmailAddress-1.0-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\RandomIDCard-1.0-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\RandomIPAddress-1.0-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\RandomLogAndLat-1.0-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\RandomLogAndLatHZ-1.0-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\randomRecordId-1.0-SNAPSHOT.jar;D:\apache-jmeter-5.1.1\lib\ext\RSA.jar;D:\apache-jmeter-5.1.1\lib\ext\RSAForJudiccature.jar;D:\apache-jmeter-5.1.1\lib\ext\rtsp_play.jar;D:\apache-jmeter-5.1.1\lib\ext\spring-core-5.2.0.M3.jar;D:\apache-jmeter-5.1.1\lib\ext\test.jar;D:\apache-jmeter-5.1.1\lib\ext\tomcat-embed-core-9.0.21.jar;D:\apache-jmeter-5.1.1\lib\ext\workNum.jar;D:\apache-jmeter-5.1.1\lib\ext\WriteTxt.jar;D:\apache-jmeter-5.1.1\lib\ext\XSPassword.jar;D:\apache-jmeter-5.1.1\lib\junit\test.jar
java.class.version=52.0
java.endorsed.dirs=C:\Program Files\Java\jdk1.8.0_101\jre\lib\endorsed
java.ext.dirs=C:\Program Files\Java\jdk1.8.0_101\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
java.home=C:\Program Files\Java\jdk1.8.0_101\jre
java.io.tmpdir=C:\Users\27988\AppData\Local\Temp
java.library.path=C:\Program Files\Java\jdk1.8.0_101\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\WinRAR;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.8.0_101\bin;C:\Program Files\Java\jre1.8.0_101\bin;C:\Program Files\PuTTY;C:\Users\27988\AppData\Local\Programs\Python\Python39;C:\Users\27988\AppData\Local\Programs\Python\Python39\Scripts;C:\Program Files\nodejs;C:\Program Files\Git\bin;C:\Program Files\Git\cmd;D:\Test\apache-jmeter-5.1\bin;C:\Users\27988\AppData\Local\Microsoft\WindowsApps;C:\Users\27988\AppData\Roaming\npm;C:\Program Files\Git\bin;C:\Program Files\Git\cmd;D:\1.JAVA\apache-ant-1.10.7\bin;D:\JMeterOriginCode\apache-jmeter-5.1\bin;C:\Program Files\Tesseract-OCR;C:\Users\27988\AppData\Local\Microsoft\WindowsApps;C:\Users\27988\AppData\Roaming\npm;C:\Program Files\Git\bin;C:\Program Files\Git\cmd;;.
java.runtime.name=Java™ SE Runtime Environment
java.runtime.version=1.8.0_101-b13
java.security.egd=file:/dev/urandom
java.specification.name=Java Platform API Specification
java.specification.vendor=Oracle Corporation
java.specification.version=1.8
java.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
java.vendor.url.bug=http://bugreport.sun.com/bugreport/
java.version=1.8.0_101
java.vm.info=mixed mode
java.vm.name=Java HotSpot™ 64-Bit Server VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Oracle Corporation
java.vm.specification.version=1.8
java.vm.vendor=Oracle Corporation
java.vm.version=25.101-b13
jmeter.logfile=jmeter.log
line.separator=log4j.configurationFile=file:/D:/apache-jmeter-5.1.1/bin/log4j2.xml
os.arch=amd64
os.name=Windows 10
os.version=10.0
path.separator=;
sun.arch.data.model=64
sun.awt.enableExtraMouseButtons=true
sun.boot.class.path=C:\Program Files\Java\jdk1.8.0_101\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_101\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_101\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_101\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_101\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_101\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_101\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_101\jre\classes
sun.boot.library.path=C:\Program Files\Java\jdk1.8.0_101\jre\bin
sun.cpu.endian=little
sun.cpu.isalist=amd64
sun.desktop=windows
sun.io.unicode.encoding=UnicodeLittle
sun.java.command=ApacheJMeter.jar
sun.java.launcher=SUN_STANDARD
sun.jnu.encoding=GBK
sun.management.compiler=HotSpot 64-Bit Tiered Compilers
sun.net.http.allowRestrictedHeaders=true
sun.os.patch.level=
sun.stderr.encoding=ms936
sun.stdout.encoding=ms936
user.country=CN
user.dir=D:\apache-jmeter-5.1.1\bin
user.home=C:\Users\XXX
user.language=en
user.name=XXXX
user.region=EN
user.script=
user.timezone=Asia/Shanghai
user.variant=
总结
JMeter的调试取样器是测试工程师不可或缺的工具之一,它简化了测试脚本的调试过程,提高了问题定位的效率。通过合理利用其功能,可以显著提升测试脚本的质量和可靠性。