过早优化是万恶之源——计算机科学界的著名学者和计算机程序设计的先驱之一Donald Knuth
第五章 性能测试
5.1生成性能测试测试数据
使用Excel生成了一张数据表,内容如下。
数据5-0性能测试测试数据
User000,Password@000,13681730000,xianggu000@126.com
User001,Password@001,13681730001,xianggu001@126.com
User002,Password@002,13681730002,xianggu002@126.com
…
User999,Password@999,13681730999,xianggu999@126.com接着,编写程序并上传到测试机上,向数据库User表中注入1000条测试用户数据。
代码5-1 test_for_data.py
#-*-coding:utf-8-*-
import pymysql
import hashlib
class ClassDB:
#初始化数据库连接
def initDB(self):
host='192.168.31.184'
user='root'
password='123456'
database='ebusiness'
#创建数据库连接
connection=pymysql.connect(host=host,user=user,password=password,database=database,charset='utf8')
return connection
#关闭数据库连接
def closedb(self,connection):
connection.close()
#初始化数据
def init_login(self):
connection=self.initDB()
try:
with connection.cursor()as cursor:
for i in range(1000):
username="User"+f"{i:03d}"
password=self.hash_password("Password@"+f"{i:03d}")
phone="13681730"+f"{i:03d}"
email="xianggu"+f"{i:03d}"+"@126.com"
sql="INSERT INTO user(username,password,phone,email)VALUES(\""+username+"\",\""+password+"\",\""+phone+"\",\""+email+"\")"
#执行SQL语句
cursor.execute(sql)
#提交事务
connection.commit()
finally:
self.closedb(connection)
#对密码SHA256散列
def hash_password(self,password):
"""对密码进行SHA256散列"""
return hashlib.sha256(password.encode('utf-8')).hexdigest()
if __name__=="__main__":
db=ClassDB()
db.init_login()5.2搭建性能测试脚本
在搭建性能测试脚本过程中,发现了以下两个问题。
5.2.1解决使用类似192.168.1.164网络IP地址无法访问产品
提示词
使用Java开发代码,使用Cookie cookie=new Cookie(this.cookies_name,this.cookies_value);设置cookie,127.0.0.1可以设置,而192.168.1.164局域网IP地址无法设置,请问为什么?
ChatGPT回答
在Java开发中,如果你使用Cookie cookie=new Cookie(this.cookies_name,this.cookies_value);设置Cookie,并且在127.0.0.1上可以成功设置,但在局域网IP地址192.168.1.164上无法设置,可能是由于以下几个原因。
1.Cookie的Domain属性
•如果没有设置Domain属性,Cookie默认只会在设置它的主机上有效。因此,如果你在127.0.0.1上设置了Cookie,而在192.168.1.164上访问,Cookie不会被发送。
2.路径限制
•确保在设置Cookie时,Path属性设置正确。默认情况下,Cookie只在设置它的路径及其子路径下有效。
3.SameSite属性
•某些浏览器可能会对Cookie的SameSite属性施加限制,影响Cookie的传递。
4.HTTP和HTTPS
•如果你在127.0.0.1上使用http协议,而在192.168.1.164上使用https协议,可能会导致Cookie的传递问题。确保协议一致。
5.浏览器设置
•某些浏览器可能会有特定的设置或扩展,影响Cookie的存储和访问。确保没有启用任何阻止Cookie的设置或扩展。
6.示例代码
以下是一个示例代码,展示如何在Java Servlet中设置Cookie,并确保在局域网IP地址上也能成功设置。
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class CookieExampleServlet extends HttpServlet{
private String cookies_name="myCookie";
private String cookies_value="myValue";
protected void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
//创建 Cookie
Cookie cookie=new Cookie(this.cookies_name,this.cookies_value);
//设置 Cookie 的有效路径
cookie.setPath("request.getContextPath()");
//设置 Cookie 的 Domain 属性
cookie.setDomain("192.168.31.184");//确保这里的域名与访问的IP匹配
//设置 Cookie 的有效期(可选)
cookie.setMaxAge(60*60);//1小时
//添加 Cookie 到响应
response.addCookie(cookie);
response.getWriter().println("Cookie has been set.");
}
}7.解决方案
•设置Domain属性:确保在设置Cookie时,正确指定Domain 属性为192.168.1.164。
•检查路径:确保Path属性设置为/,以便在整个应用中都能访问。
•使用一致的协议:确保在127.0.0.1和192.168.31.184上使用相同的协议(HTTP或HTTPS)。
•检查浏览器设置:确保没有浏览器扩展或设置阻止Cookie。
通过这些检查和调整,应该能够解决在局域网IP地址上无法设置Cookie的问题。如果问题仍然存在,请提供更多上下文信息,以便进一步帮助。
根据反馈进行排查后,最终修改的代码如下。
代码5-2 CookiesManager.java
public void setCookie(){
if(this.cookies_value!=null&&!this.cookies_value.isEmpty()){
try{
Cookie cookie=new Cookie(this.cookies_name,this.cookies_value);
cookie.setPath(request.getContextPath());//确保在应用的上下文中可用
cookie.setMaxAge(60*60*24);//1天
cookie.setHttpOnly(true);
response.addCookie(cookie);
}catch(Exception e){
logger.error(e.getMessage());
}
}else{
//处理cookies为空的情况
logger.info("cookie 为空.");
}
}其中,
cookie.setPath(request.getContextPath());方法是一个关键设置,而
cookie.setDomain("192.168.31.184");的配置则可以视情况而定。
clearCookie()也需要修改为。
代码5-3 CookiesManager.java
//清空Cookie
public void clearCookie(){
Cookie expiredCookie=new Cookie(cookies_name,"");
expiredCookie.setMaxAge(0);//设置为立即过期
expiredCookie.setPath(request.getContextPath());//确保路径一致,以便被正确清除
response.addCookie(expiredCookie);
}完成代码修改后,还需要调整两个关于CookiesManager类的单元测试方法。
代码5-3 CookiesManagerTest.java
//测试设置具有有效值的cookie
@Test
void testSetCookie(){
cookiesManager.setCookie();
verify(response).addCookie(argThat(cookie->
"testCookie".equals(cookie.getName())&&
"testValue".equals(cookie.getValue())&&
cookie.getMaxAge()==60*60*24
));
}
//测试清除cookie
@Test
void testClearCookie(){
cookiesManager.clearCookie();
verify(response).addCookie(argThat(cookie->
"testCookie".equals(cookie.getName())&&
cookie.getMaxAge()==0));
}5.2.2 JMeter无法访问远端数据库
遇到的第二个问题中,JMeter无法访问被测端的数据库,询问ChatGPT。
提示词
JDBC Driver没有发现:Access denied for user 'root'@'192.168.31.184' to database 'ebusiness'。
ChatGPT回答
错误ERROR 1396(HY000):Operation ALTER USER failed for 'root'@'192.168.31.184'通常表示在尝试修改用户时出现了问题。以下是一些可能的原因和解决方案。
1.可能的原因
•用户不存在:你尝试修改的用户可能并不存在于数据库中。请确保用户'root'@'192.168.31.184'确实存在。
•权限问题:当前连接的用户可能没有足够的权限来执行ALTER USER操作。确保你以具有足够权限的用户身份连接到数据库。
•用户主机不匹配:MySQL用户是基于账号和主机名的组合来识别的。如果你在其他主机上创建了用户'root',但在'192.168.31.184'上没有相应的用户,可能会导致此错误。
•MySQL版本问题:在某些MySQL版本中,可能会有特定的限制或已知问题。确保你的MySQL版本是最新的,或者查看相关的版本文档。
2.解决方案
•检查用户是否存在:你可以通过以下SQL查询来检查用户是否存在。
SELECT User,Host FROM mysql.user WHERE User='root';确保'root'@'192.168.31.184'在结果中。
•使用正确的主机名:如果你不确定主机名,可以尝试使用%来表示所有主机。
ALTER USER 'root'@'%' IDENTIFIED BY 'new_password';
•以具有足够权限的用户身份连接:确保你以具有GRANT权限的用户身份连接到MySQL。通常,使用root用户连接时应该有足够的权限。
第1步:创建用户
•如果用户不存在,你可以创建一个新的用户。
CREATE USER 'root'@'192.168.31.184' IDENTIFIED BY 'new_PASSWORD';第2步:检查MySQL错误日志
•如果以上步骤都没有解决问题,查看MySQL错误日志可能会提供更多信息。
3.示例
以下是一个完整的示例,展示如何检查用户并修改密码。
--检查用户是否存在
SELECT User,Host FROM mysql.user WHERE User='root';
--如果用户存在,尝试修改密码
ALTER USER 'root'@'192.168.31.184' IDENTIFIED BY 'new_password';
--如果用户不存在,创建用户
CREATE USER 'root'@'192.168.31.184' IDENTIFIED BY 'new_password';通过这些步骤,你应该能够解决ERROR 1396的问题。如果问题仍然存在,请提供更多上下文信息,以便进一步帮助根据提示。
注解:根据提示,进行了以下修改,登录数据库并执行查询。
SELECT User,Host FROM mysql.user WHERE User='root';发现已有记录
root localhost接着创建用户并赋予权限
CREATE USER 'root'@'192.168.31.184' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON ebusiness.* TO 'root'@'192.168.31.184';
FLUSH PRIVILEGES;重新启动MySQL,测试成功。
5.2.3搭建JMeter脚本
如下图所示搭建JMeter脚本,如图5-1所示。保证低负载情况下性能测试能够正常运行。

图5-1 测试登录电子商务JMeter脚本
登录并发用户(同步定时器)设置为在线用户数的10%。
ChatGPT.jmx代码如下。
代码5-4 ChatGPT.jmx
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.3">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="测试计划">
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="用户定义的变量">
<collectionProp name="Arguments.arguments"/>
</elementProp>
</TestPlan>
<hashTree>
<CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie管理器">
<collectionProp name="CookieManager.cookies"/>
<boolProp name="CookieManager.clearEachIteration">false</boolProp>
<boolProp name="CookieManager.controlledByThreadGroup">false</boolProp>
</CookieManager>
<hashTree/>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP信息头管理器" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="Accept-Language" elementType="Header">
<stringProp name="Header.name">Accept-Language</stringProp>
<stringProp name="Header.value">zh-CN,zh;q=0.9</stringProp>
</elementProp>
<elementProp name="Upgrade-Insecure-Requests" elementType="Header">
<stringProp name="Header.name">Upgrade-Insecure-Requests</stringProp>
<stringProp name="Header.value">1</stringProp>
</elementProp>
<elementProp name="Accept-Encoding" elementType="Header">
<stringProp name="Header.name">Accept-Encoding</stringProp>
<stringProp name="Header.value">gzip,deflate</stringProp>
</elementProp>
<elementProp name="User-Agent" elementType="Header">
<stringProp name="Header.name">User-Agent</stringProp>
<stringProp name="Header.value">Mozilla/5.0(Windows NT 10.0;Win64;x64)AppleWebKit/537.36(KHTML,like Gecko)Chrome/131.0.0.0 Safari/537.36</stringProp>
</elementProp>
<elementProp name="Accept" elementType="Header">
<stringProp name="Header.name">Accept</stringProp>
<stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7</stringProp>
</elementProp>
</collectionProp>
</HeaderManager>
<hashTree/>
<ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP请求默认值" enabled="true">
<stringProp name="HTTPSampler.domain">192.168.31.184</stringProp>
<stringProp name="HTTPSampler.port">8080</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.contentEncoding">utf-8</stringProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.implementation">Java</stringProp>
</ConfigTestElement>
<hashTree/>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="线程组">
<intProp name="ThreadGroup.num_threads">4062</intProp>
<intProp name="ThreadGroup.ramp_time">1</intProp>
<longProp name="ThreadGroup.duration">600</longProp>
<longProp name="ThreadGroup.delay">10</longProp>
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
<boolProp name="ThreadGroup.scheduler">true</boolProp>
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器">
<intProp name="LoopController.loops">-1</intProp>
<boolProp name="LoopController.continue_forever">false</boolProp>
</elementProp>
</ThreadGroup>
<hashTree>
<LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
<stringProp name="LoopController.loops">1000</stringProp>
</LoopController>
<hashTree>
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV 数据文件设置" enabled="true">
<stringProp name="filename">testdata.csv</stringProp>
<stringProp name="fileEncoding">UTF-8</stringProp>
<stringProp name="variableNames">usrename,password,phone,email</stringProp>
<boolProp name="ignoreFirstLine">false</boolProp>
<stringProp name="delimiter">,</stringProp>
<boolProp name="quotedData">false</boolProp>
<boolProp name="recycle">true</boolProp>
<boolProp name="stopThread">false</boolProp>
<stringProp name="shareMode">shareMode.all</stringProp>
</CSVDataSet>
<hashTree/>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="登录页面" enabled="true">
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.path">/CharGPTEbusiness/jsp/LoginPage.jsp</stringProp>
<boolProp name="HTTPSampler.auto_redirects">true</boolProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
<collectionProp name="Arguments.arguments"/>
</elementProp>
</HTTPSamplerProxy>
<hashTree>
<SyncTimer guiclass="TestBeanGUI" testclass="SyncTimer" testname="同步定时器" enabled="true">
<intProp name="groupSize">100</intProp>
<longProp name="timeoutInMs">0</longProp>
</SyncTimer>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="2027347842"><title>登录页面</title></stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message"></stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
</ResponseAssertion>
<hashTree/>
<BoundaryExtractor guiclass="BoundaryExtractorGui" testclass="BoundaryExtractor" testname="边界提取器" enabled="true">
<stringProp name="BoundaryExtractor.useHeaders">false</stringProp>
<stringProp name="BoundaryExtractor.refname">mytoken</stringProp>
<stringProp name="BoundaryExtractor.lboundary"><input type="hidden"id="csrftoken"name="csrftoken"value="</stringProp>
<stringProp name="BoundaryExtractor.rboundary">"></stringProp>
<stringProp name="BoundaryExtractor.default">Error</stringProp>
<boolProp name="BoundaryExtractor.default_empty_value">false</boolProp>
<stringProp name="BoundaryExtractor.match_number">1</stringProp>
</BoundaryExtractor>
<hashTree/>
<UniformRandomTimer guiclass="UniformRandomTimerGui" testclass="UniformRandomTimer" testname="统一随机定时器" enabled="true">
<stringProp name="ConstantTimer.delay">3000</stringProp>
<stringProp name="RandomTimer.range">5000</stringProp>
</UniformRandomTimer>
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="登录成功页面" enabled="true">
<stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.path">/CharGPTEbusiness/jsp/LoginPage.jsp</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
<collectionProp name="Arguments.arguments">
<elementProp name="csrftoken" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.name">csrftoken</stringProp>
<stringProp name="Argument.value">${mytoken}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
</elementProp>
<elementProp name="username" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.name">username</stringProp>
<stringProp name="Argument.value">${usrename}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
</elementProp>
<elementProp name="password" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.name">password</stringProp>
<stringProp name="Argument.value">${__digest(SHA256,${password},,,)}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
</elementProp>
</collectionProp>
</elementProp>
</HTTPSamplerProxy>
<hashTree>
<SyncTimer guiclass="TestBeanGUI" testclass="SyncTimer" testname="同步定时器" enabled="true">
<intProp name="groupSize">100</intProp>
<longProp name="timeoutInMs">0</longProp>
</SyncTimer>
<hashTree/>
<CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie管理器" enabled="true">
<collectionProp name="CookieManager.cookies">
<elementProp name="csrftoken" elementType="Cookie" testname="csrftoken">
<stringProp name="Cookie.value">${mytoken}</stringProp>
<stringProp name="Cookie.domain">/CharGPTEbusiness/</stringProp>
<stringProp name="Cookie.path"></stringProp>
<boolProp name="Cookie.secure">false</boolProp>
<longProp name="Cookie.expires">0</longProp>
<boolProp name="Cookie.path_specified">true</boolProp>
<boolProp name="Cookie.domain_specified">true</boolProp>
</elementProp>
</collectionProp>
<boolProp name="CookieManager.clearEachIteration">false</boolProp>
<boolProp name="CookieManager.controlledByThreadGroup">false</boolProp>
</CookieManager>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="896036527"><title>系统欢迎您</title></stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message"></stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
</ResponseAssertion>
<hashTree/>
<UniformRandomTimer guiclass="UniformRandomTimerGui" testclass="UniformRandomTimer" testname="统一随机定时器" enabled="true">
<stringProp name="ConstantTimer.delay">3000</stringProp>
<stringProp name="RandomTimer.range">4000</stringProp>
</UniformRandomTimer>
<hashTree/>
</hashTree>
</hashTree>
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="调试取样器" enabled="true">
<boolProp name="displayJMeterProperties">false</boolProp>
<boolProp name="displayJMeterVariables">true</boolProp>
<boolProp name="displaySystemProperties">false</boolProp>
</DebugSampler>
<hashTree/>
<ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="汇总报告">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>true</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<sentBytes>true</sentBytes>
<url>true</url>
<threadCounts>true</threadCounts>
<idleTime>true</idleTime>
<connectTime>true</connectTime>
</value>
</objProp>
<stringProp name="filename">C:\Users\xiang\Desktop\code\JMeter\logfile1.jtl</stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="StatGraphVisualizer" testclass="ResultCollector" testname="汇总图">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>true</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<sentBytes>true</sentBytes>
<url>true</url>
<threadCounts>true</threadCounts>
<idleTime>true</idleTime>
<connectTime>true</connectTime>
</value>
</objProp>
<stringProp name="filename">C:\Users\xiang\Desktop\code\JMeter\logfile1.jtl</stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="图形结果">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>true</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<sentBytes>true</sentBytes>
<url>true</url>
<threadCounts>true</threadCounts>
<idleTime>true</idleTime>
<connectTime>true</connectTime>
</value>
</objProp>
<stringProp name="filename">C:\Users\xiang\Desktop\code\JMeter\logfile1.jtl</stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="查看结果树" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>true</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<sentBytes>true</sentBytes>
<url>true</url>
<threadCounts>true</threadCounts>
<idleTime>true</idleTime>
<connectTime>true</connectTime>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
</hashTree>
</jmeterTestPlan>顾翔凡言:AI时代,掌握已知的未知已非难事,关键在于如何发现未知的未知——而它往往就藏在探索已知之未知的过程中。