我是JMeter的新手,我试图让JMeter为现有的测试脚本生成html报告仪表板。我在处理过程中没有任何异常,日志表明生成报告没有问题:
2016/07/08 12:42:24 DEBUG - jmeter.report.dashboard.ReportGenerator: Start report generation
2016/07/08 12:42:25 INFO - jmeter.report.processor.NormalizerSampleConsumer: Using format:ms to parse timeStamp field
2016/07/08 12:42:25 DEBUG - jmeter.report.dashboard.ReportGenerator: Start samples processing
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.AggregateConsumer#stopProducing(): beginDate produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.AggregateConsumer#stopProducing(): endDate produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.ApdexSummaryConsumer#stopProducing(): apdexSummary produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.RequestsSummaryConsumer#stopProducing(): requestsSummary produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.StatisticsSummaryConsumer#stopProducing(): statisticsSummary produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.ErrorsSummaryConsumer#stopProducing(): errorsSummary produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.LatencyVSRequestGraphConsumer#stopProducing(): latencyVsRequest produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.HitsPerSecondGraphConsumer#stopProducing(): hitsPerSecond produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.CodesPerSecondGraphConsumer#stopProducing(): codesPerSecond produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimeVSRequestGraphConsumer#stopProducing(): responseTimeVsRequest produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.FilterConsumer#stopProducing(): startIntervalControlerFilter produced 4175 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimePercentilesGraphConsumer#stopProducing(): responseTimePercentiles produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimeOverTimeGraphConsumer#stopProducing(): responseTimesOverTime produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.BytesThroughputGraphConsumer#stopProducing(): bytesThroughputOverTime produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ActiveThreadsGraphConsumer#stopProducing(): activeThreadsOverTime produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.TimeVSThreadGraphConsumer#stopProducing(): timeVsThreads produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimeDistributionGraphConsumer#stopProducing(): responseTimeDistribution produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.LatencyOverTimeGraphConsumer#stopProducing(): latenciesOverTime produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.TransactionsPerSecondGraphConsumer#stopProducing(): transactionsPerSecond produced 0 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.FilterConsumer#stopProducing(): nameFilter produced 10020 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.AbstractSampleConsumer: class org.apache.jmeter.report.processor.NormalizerSampleConsumer#stopProducing(): normalizer produced 2505 samples
2016/07/08 12:42:25 INFO - org.apache.jmeter.report.processor.CsvFileSampleSource: produce(): 835 samples produced in 481ms on channel 0
2016/07/08 12:42:25 DEBUG - jmeter.report.dashboard.ReportGenerator: End of samples processing
2016/07/08 12:42:25 DEBUG - jmeter.report.dashboard.ReportGenerator: Start data exporting
2016/07/08 12:42:25 INFO - jmeter.report.dashboard.ReportGenerator: Exporting data using exporter:'html' of className:'org.apache.jmeter.report.dashboard.HtmlTemplateExporter'
2016/07/08 12:42:25 DEBUG - jmeter.report.dashboard.HtmlTemplateExporter: Start template processing
2016/07/08 12:42:25 INFO - jmeter.report.dashboard.HtmlTemplateExporter: Will generate dashboard in folder:/tmp/jmeter
2016/07/08 12:42:26 INFO - jmeter.report.dashboard.HtmlTemplateExporter: Report will be generated in:/tmp/jmeter, creating folder structure
2016/07/08 12:42:26 DEBUG - jmeter.report.dashboard.HtmlTemplateExporter: End of template processing
2016/07/08 12:42:26 DEBUG - jmeter.report.dashboard.ReportGenerator: End of data exporting
2016/07/08 12:42:26 DEBUG - jmeter.report.dashboard.ReportGenerator: End of report generation
但是,当我查看生成的index.html文件时,没有数据:
result.csv文件不是空的:
我的reportgenerator和saveservice配置是:
#---------------------------------------------------------------------------
# Reporting configuration
#---------------------------------------------------------------------------
# If you want to debug reporting, uncomment this line
log_level.jmeter.report=DEBUG
jmeter.reportgenerator.report_title=AMP JMeter-test Dashboard
jmeter.reportgenerator.overall_granularity=6000
jmeter.reportgenerator.temp_dir = /tmp
#---------------------------------------------------------------------------
# Results file configuration
#---------------------------------------------------------------------------
jmeter.save.saveservice.output_format=csv
# assertion_results_failure_message only affects CSV output
jmeter.save.saveservice.assertion_results_failure_message=true
jmeter.save.saveservice.assertion_results=all
#jmeter.save.saveservice.data_type=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.subresults=true
jmeter.save.saveservice.assertions=true
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.timestamp_format=ms
jmeter.save.saveservice.default_delimiter=,
jmeter.save.saveservice.print_field_names=true
csvread.delimiter=,
我试图搜索类似的问题(这里和其他地方),但我找不到任何可以解决这种情况的问题。结果将以我期望的格式在CSV文件中编写和填充,但在读取数据时似乎出现了问题。如果我至少可以填充错误和结果汇总部分,我会很高兴。
我注意到在日志中(包含在代码片段中),有很多0个样本被报告用于不同的事情......但我想我只关心CsvFileSampleSource,它正确地识别为800-something样品...
另外,我运行我的测试:
jmeter -n -t /path/to/my/amp_automation.jmx -l /tmp/result.csv -e -o /tmp/jmeter
任何见解都会受到赞赏,我可能会在这里遗漏一些东西。理想情况下,我不希望恢复到年龄较大的"获取为jmeter生成的html报告的方法(使用ant或其他听众等)
谢谢!
答案 0 :(得分:4)
我有类似的问题。我意识到我在.jtl报告中使用双引号作为HTTP请求名称之一。我从jtl中删除了双引号,重新生成了仪表板。它就像一个魅力!
答案 1 :(得分:3)
答案 2 :(得分:1)
在user.properties文件中尝试添加:
jmeter.reportgenerator.sample_filter=.*
jmeter.reportgenerator.exporter.html.series_filter=.*
如前面的答案中所述,请检查您的过滤。
出于调试目的,我建议您使用命令行-g选项将仪表板生成分离为运行后调试此问题,这样您就可以获得不太繁忙的jmeter.log
查看jmeter.log,它应该准确显示正在读取哪些值以及如何设置。你想确保你没有通过"无"值尤其适用于sample_filter!
答案 3 :(得分:1)
你想从哪里打开报告? 其他生成的文件夹(如内容,sbadmin)是否位于同一位置?
我改变了index.html文件的位置,所以我遇到了同样的问题。 请确保您从jmeter创建的文件夹中访问index.html文件。
答案 4 :(得分:1)
我今天遇到了类似的情况,在调查网页时,我发现图表是从JavaScript生成的。当我查看Chrome中的开发控制台时,我发现JavaScript嵌入了双引号创建的语法错误。我还没有100%的解决方案,但认为这可能是你要检查的东西。我从我的csv文件中删除了转义的引号并重新生成了我的报告,并得到了我期待的输出。
答案 5 :(得分:1)
错误在csv文件中可见:
不要在采样器名称中使用双引号(“)。它们是在没有任何转义到.csv文件的情况下编写的,仪表板渲染器将它们按原样写入javascript。这会导致javascript中的解析错误表格单元格中的采样器名称,因此没有任何内容被渲染。
答案 6 :(得分:0)
请使用以下命令在cmd中生成报告为什么因为您已经有结果csv文件,使用此文件可以生成报告,请使用以下命令根据您的结果csv文件生成报告。
首先在cmd中你需要转到cmd中的jmeter / bin文件夹,然后输入以下命令并替换为你的路径
jmeter -g E:\Jmeter_Performance_Testing\Silver\SAPPI_Redemption\TestResults\SAPPIRedemption.csv -o E:\Jmeter_Performance_Testing\Silver\SAPPI_Redemption\HTMLReports
jmeter -g path(结果csv文件的路径)-o path(报告应显示的路径)。 让我知道您的反馈意见。
答案 7 :(得分:0)
HTML Publisher插件版本1.14
这些都不适合我,但最后几篇关于逃脱角色的帖子让我走上正轨。
我的Jenkins安全策略阻止了生成的index.html上的javascript。这是一篇很好的帖子,可以帮助您解决问题:
答案 8 :(得分:0)
我遇到了同样的问题,在尝试了许多事情之后我猜测我的文件名太长了。我缩短了文件名,现在我可以看到按预期生成的报告。见下面的例子。
jmeter -g Picking_Aggregate_Report_Success_16_890000.csv -o Picking_Aggregate_Report_Success_16_890000_Dashboard\
制作空白报告
jmeter -g Picking_Aggregate_Report_Success.csv -o Picking_Aggregate_Report_Success_Dashboard\
制作了可见的报告
jmeter -g Picking_Aggregate_Report_Error_16_890000.csv -o Picking_Aggregate_Report_Error_16_890000_Dashboard\
制作了可见的报告
除了更改文件名以使其正常工作外,别无其他。
我认为文件名的参数有一些最大长度,大约有40个字符,并且如果它超过了它就会出现静默失败。
答案 9 :(得分:-1)
我认为你的user.properties需要添加以下内容: jmeter.reportgenerator.exporter.html.series_filter =((^你的标签名称)|(^ ...))( - 成功| -failure)?
正如您提供的result.csv内容。 也许你可以添加如下:
jmeter.reportgenerator.exporter.html.series_filter =((^ login)|(^ create user))( - success | -failure)?
我建议您可以将reportgenerator.properties中的全部内容粘贴到user.properties。然后设置“jmeter.reportgenerator.exporter.html.series_filter”可以快速解决您的问题。 希望这可以帮到你。祝你好运。