gpt4 book ai didi

java - 从 Jenkins 运行时出现 JMeter 错误 "java.lang.NumberFormatException: For input string: "时间戳”

转载 作者:行者123 更新时间:2023-11-30 02:52:00 28 4
gpt4 key购买 nike

通过 Jenkins 运行 JMeter 脚本时出现以下错误。无法找出导致错误的原因。

Performance: Failed to parse file 'C:\Program Files (x86)\Jenkins\jobs\JMeter Test\builds\12\performance-reports\JMeter\test.jtl': For input string: "timeStamp"
java.lang.NumberFormatException: For input string: "timeStamp"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at java.lang.Long.valueOf(Unknown Source)
at hudson.plugins.performance.JMeterCsvParser.getSample(JMeterCsvParser.java:153)
at hudson.plugins.performance.JMeterCsvParser.parse(JMeterCsvParser.java:124)
at hudson.plugins.performance.JMeterParser.parseCsv(JMeterParser.java:189)
at hudson.plugins.performance.JMeterParser.parse(JMeterParser.java:48)
at hudson.plugins.performance.AbstractParser.parse(AbstractParser.java:56)
at hudson.plugins.performance.PerformancePublisher.perform(PerformancePublisher.java:347)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Email was triggered for: Always
Sending email for trigger: Always
Finished: SUCCESS

下面是test.jtl文件的内容

timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,grpThreads,allThreads,Latency,IdleTime
1468432148291,2027,178 /BOT/,Non HTTP response code: java.net.ConnectException,Non HTTP response message: Connection refused: connect,Clock-in / Clock-out Tests 1-1,text,false,,2204,7,7,0,0
1468432148608,2020,178 /BOT/,Non HTTP response code: java.net.ConnectException,Non HTTP response message: Connection refused: connect,Clock-in / Clock-out Tests 1-2,text,false,,2204,8,8,0,0
1468432148941,2024,178 /BOT/,Non HTTP response code: java.net.ConnectException,Non HTTP response message: Connection refused: connect,Clock-in / Clock-out Tests 1-3,text,false,,2204,9,9,0,0
1468432149255,1993,178 /BOT/,Non HTTP response code: java.net.ConnectException,Non HTTP response message: Connection refused: connect,Clock-in / Clock-out Tests 1-4,text,false,,2204,9,9,0,0

最佳答案

根据Continuous Integration 101: How to Run JMeter With Jenkins文章可能是由于格式不匹配,即 Jenkins Performance Plugin期望 XML 并获取 CSV。

For your first couple of runs, I recommend “telling” JMeter to store its results in an XML format using one of these approaches:

  • Add the ``jmeter.save.saveservice.output_format=xml line to the user.properties file (this is located in /bin folder of your JMeter installation

  • Pass the property via the -J command-line argument, such as: C:\jmeter\bin\jmeter.bat -Jjmeter.save.saveservice.output_format=xml -n -t C:\jmeter\extras\Test.jmx -l Test.jtl

You can also use CSV files with the Performance Plugin. However, this requires extra configuration whereas XML files work fine out of the box.

关于java - 从 Jenkins 运行时出现 JMeter 错误 "java.lang.NumberFormatException: For input string: "时间戳”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38359103/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com