jtl文件没有在jenkins中为jmeter解析

时间:2013-10-03 16:40:43

标签: jenkins jmeter jenkins-plugins

我正在尝试从Jenkins运行jmeter测试。我已经安装了性能插件并重新启动了jenkins。我不想使用任何maven / ant。

执行shell命令

 cd /Users/Shared/Jenkins/Home/jobs/meineTui-QA-Test-Jmeter/workspace 
 java -jar /Users/Shared/Jenkins/apache-jmeter/bin/ApacheJMeter.jar  -n -t Login_Logout.jmx -l result.jtl 

在jenkin->的后期构建动作中发布性能测试结果报告 - > jmeter - >报告文件 - > ** / * .jtl

当我从jenkin运行时,控制台说

 Performance: Failed to parse /Users/Shared/Jenkins/Home/jobs/meineTui-QA-Test-Jmeter/builds/2013-10-03_17-14-53/performance-reports/JMeter/result.jtl: Content is not allowed in prolog. 

所以我无法在效果报告部分查看结果/报告。任何建议如何解决。

==================================控制台输出=========== ==

+ cd /Users/Shared/Jenkins/Home/jobs/meineTui-QA-Test-Jmeter/workspace 
+ java -jar /Users/Shared/Jenkins/apache-jmeter/bin/ApacheJMeter.jar -n -t Login_Logout.jmx -l result.jtl 
Creating summariser <summary>
Created the tree successfully using Login_Logout.jmx 
Starting the test @ Thu Oct 03 17:14:55 BST 2013 (1380816895721) 
Waiting for possible shutdown message on port 4445 
 summary +      2 in   4.1s =    0.5/s Avg:  2013 Min:   766 Max:  3260 Err:     0 (0.00%)   Active: 1 Started: 1 Finished: 0 
 summary +     10 in     4s =    2.5/s Avg:   392 Min:   286 Max:   573 Err:     0 (0.00%)  Active: 0 Started: 1 Finished: 1 
  summary =     12 in     8s =    1.5/s Avg:   662 Min:   286 Max:  3260 Err:     0 (0.00%) 
  Tidying up ...    @ Thu Oct 03 17:15:04 BST 2013 (1380816904307) 
 ... end of run 
 Performance: Percentage of errors greater or equal than 0% sets the build as unstable 
 Performance: Percentage of errors greater or equal than 0% sets the build as failure 
 Performance: Recording JMeter reports '**/*.jtl' 
 Performance: Parsing JMeter report file result.jtl 
 Performance: Failed to parse /Users/Shared/Jenkins/Home/jobs/meineTui-QA-Test-Jmeter/builds /2013-10-03_17-14-53/performance-reports/JMeter/result.jtl: Content is not allowed in prolog. 
 Finished: SUCCESS 

result.jtl

1380816896268,766,登录,200,OK,Group1 1-1,text,true,230,766 1380816897071,3260,Reservations,200,OK,Group1 1-1,text,true,3295,3260 1380816900339,335,ReservationID,200,OK,Group1 1-1,text,true,8683,335 1380816900681,353,天气,200,OK,Group1 1-1,text,true,2022,353 1380816901039,563,摘要,200,OK,Group1 1-1,text,true,6528,563 1380816901607,573,Home,200,OK,Group1 1-1,text,true,11955,573 1380816902187,329,HolidayCountdown,200,OK,Group1 1-1,text,true,344,329 1380816902520,375,Contacts,200,OK,Group1 1-1,text,true,2835,375 1380816902899,286,Excursions,200,OK,Group1 1-1,text,true,237,286 1380816903189,361,TravelAgent,200,OK,Group1 1-1,text,true,570,361 1380816903554,319,简介,200,OK,Group1 1-1,text,true,395,319

2 个答案:

答案 0 :(得分:10)

在jmeter.properties文件中进行以下更改:

从以下行中删除注释并通过xml更改csv

#jmeter.save.saveservice.output_format=csv
像这样:

jmeter.save.saveservice.output_format=xml

从以下行中删除(#)评论:

jmeter.save.saveservice.data_type=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true

jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_name=true

并将要生成jtl的文件的扩展名更改为xml。

jenkins configuration

答案 1 :(得分:0)

使用最新版本的Jenkins Performance插件(例如v1.14),您可以解析CSV和XML格式。

根据结果文件的格式,您需要在&#34;发布性能测试结果报告&#34;中选择适当的报告类型。部分:

  • 选择&#34; JMeter&#34;报告类型,如果您的结果文件是XML
  • 选择&#34; JMeterCSV&#34;报告类型,如果您的结果文件是CSV。