我正在尝试从本地计算机上运行远程服务器上的JMeter测试会话。我看到测试本身按预期执行,但没有结果在非gui模式下写入jtl文件。我试着验证我所知道的一切,对我来说一切似乎都很好。
这是我的JMX文件 -
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="3.2" jmeter="3.3 r1808647">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="APIGTesting" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="MyProxyTG-Get" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<intProp name="LoopController.loops">-1</intProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">5</stringProp>
<stringProp name="ThreadGroup.ramp_time">5</stringProp>
<longProp name="ThreadGroup.start_time">1522117683000</longProp>
<longProp name="ThreadGroup.end_time">1522117683000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration">3600</stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="Get Object" enabled="true">
<elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="Proxy_APIG_Endpoint" elementType="Argument">
<stringProp name="Argument.name">Proxy_APIG_Endpoint</stringProp>
<stringProp name="Argument.value">https://3wmhcni2123.execute-api.us-east-1.amazonaws.com/dev</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="classname">com.poc.jmeter.APIGProxy_GetObject</stringProp>
</JavaSampler>
<hashTree/>
<TestAction guiclass="TestActionGui" testclass="TestAction" testname="Think Time" enabled="true">
<intProp name="ActionProcessor.action">1</intProp>
<intProp name="ActionProcessor.target">0</intProp>
<stringProp name="ActionProcessor.duration">3000</stringProp>
</TestAction>
<hashTree>
<UniformRandomTimer guiclass="UniformRandomTimerGui" testclass="UniformRandomTimer" testname="Pause" enabled="true">
<stringProp name="ConstantTimer.delay">3000</stringProp>
<stringProp name="RandomTimer.range">3000</stringProp>
</UniformRandomTimer>
<hashTree/>
</hashTree>
</hashTree>
<ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" testname="Simple Data Writer" 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>
<threadCounts>true</threadCounts>
<idleTime>true</idleTime>
<connectTime>true</connectTime>
</value>
</objProp>
<stringProp name="filename">/Users/apple/JMeter-Sessions/ProxyResults/Test9.4.csv</stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
<WorkBench guiclass="WorkBenchGui" testclass="WorkBench" testname="WorkBench" enabled="true">
<boolProp name="WorkBench.save">true</boolProp>
</WorkBench>
<hashTree/>
</hashTree>
</jmeterTestPlan>
我正在使用以下命令运行JMeter -
jmeter -n -t proxyTest.jmx -r -l ./results.jtl
我不确定有哪些其他属性可供检查,因为我可以看到当我在GUI模式下本地运行测试时,编写器本身似乎正在工作。有什么建议吗?
答案 0 :(得分:0)
很可能你的请求根本没有被执行过。从我的测试计划中可以看出,您正在使用Java Request采样器和一些自定义类,以及 com.poc.jmeter.APIGProxy_GetObject 。
在分布式模式下运行JMeter时,需要将包含com.poc.jmeter.APIGProxy_GetObject
和所有依赖项(如果有)的.jar文件复制到远程从站的JMeter Classpath。这同样适用于任何外部数据文件(CSV,属性等),任何JMeter Plugins,任何自定义。最简单的方法是将本地主JMeter文件夹复制到所有从属文件夹。
您需要重新启动从属实例才能选择.jar。
如果遇到任何其他问题,请检查从属计算机上JMeter安装的“bin”文件夹中的jmeter-server.log
文件,通常应该有足够的故障排除信息来解决问题的根源。
参考文献: