jtl文件中的Sonarqube + Jmeter错误 [英] Sonarqube + Jmeter error in jtl file
问题描述
我使用Jmeter插件安装Sonarqube.我在Jmeter中进行了以下简单测试:
i install Sonarqube with Jmeter Plugin. I have my simple test in Jmeter with:
Threads group
Http Sampler
Assertion Results
然后我将结果保存在具有jtl扩展名的本地文件中.
and i save the result in local, with jtl extension.
现在我已经在jmeter插件中为我的项目为声纳配置了本地jtl文件.
Now i have configure Local jtl file in jmeter plugin for sonar, for my project.
但是现在,如果我尝试测试我的项目,则会出现此错误:
But now if i try to test my project i have this error:
ERROR - Cannot analyse project 'My project'
es.excentia.jmeter.report.server.testresults.JtlReaderException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '1' (code 49) in prolog; expected '<'
推荐答案
Sonarqube似乎希望JMeter结果文件采用XML格式,并通过
It looks like that sonarqube expects JMeter result file to be in XML format and by default it is CSV.
结果文件的输出格式可通过jmeter.save.saveservice.output_format
属性控制,支持的值为xml
和csv
,默认值为csv.
Results file output format is controllable via jmeter.save.saveservice.output_format
property, supported values are xml
and csv
, default is csv.
根据启动JMeter测试的方式,可以通过不同方式设置属性:
Depending on how you launch your JMeter test the property can be set in different ways:
-
将下一行添加到 user.properties 文件中,该文件位于JMeter安装目录的/bin文件夹下
Add the next line to user.properties file which lives under /bin folder of your JMeter installation
jmeter.save.saveservice.output_format=xml
在 jmeter.properties 文件中查找此属性,取消注释并将其值更改为xml
Look for this property in jmeter.properties file, uncomment and change its value to xml
如果您在命令行模式下运行JMeter 该属性可以通过-J参数传递为
If you run JMeter in command-line mode the property can be passed via -J argument as
jmeter -Jjmeter.save.saveservice.output_format=xml -n -t /path/to/your/test/plan.jmx -l /path/to/results/file/jtl
有关JMeter属性类型和属性的全面信息,请参见 Apache JMeter属性自定义指南.覆盖的方式.
See Apache JMeter Properties Customization Guide for comprehensive information on JMeter's property types and ways of overriding.
这篇关于jtl文件中的Sonarqube + Jmeter错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!