Update as of November 2017:

Since JMeter 3.0, last version being 3.3, JMeter provides Out Of The Box a dynamic Web report with tons of information.

You can read an up to date blog (15th january 2019) described here.

We highly advise you to use it instead of what is described below which is no more necessary.

Report contains more sexy graphs, tables (Errors synthesis, Top 5 errors by sampler, APDEX…) that will help you analyze your load test more easily and open it in a Browser.

Creating it is just a matter of adding 2 more command-line options in NON GUI load test.

We are the proud implementers and contributors of this web-report that was partly sponsored by Decathlon (a great French and worldwide sports company).

Context

You are using Apache JMeter for your Load Tests.

Once test has ended, you would like your favorite tool to automatically generate for you nice and meaningful graphs so that you can faster analyze your test results and include them in your report.

Apache JMeter is great in many ways but its core lacks this built-in feature, but it’s plugin Architecture will let us add it easily.

Hopefully a great must have Open Source and free third-party library called JMeter-Plugins comes to the rescue.

Before version 1.1.3 of JMeter-Plugins, you could use JMeterPluginsCMD Command Line Tool to generate your graphs in a shell, but this was not optimal.

As users of both Apache JMeter and JMeter-Plugins, we decided to contribute this new feature to JMeter-Plugins.

Our philosophy is :

  • “If you use an Open-Source and free project, be grateful, always contribute in a way”

About author:

Philippe Mouawad works as an Architect and technical expert for Ubik-Ingenierie where he leads among other things the development of UbikLoadPack a set of Commercial Plugins for Apache JMeter allowing to load test different protocols like HLS, GWT, Flex.
Philippe is a committer on the Apache JMeter project and member of the PMC since October 2011.
Finally he is a co-author of a french book on JMeter called Maîriser JMeter: Du test de charge à Devops.

Feature Overview

To automatically generate your reports just add a new Listener called “jp@gc Graphs Generator“.

You can define the following properties:

Property Description/Possible Values
Graph width in pixels for PNG only – width of the image, default is 800
Graph height in pixels for PNG only – height of the image, default is 600
granulation time for samples granulation time for samples
relative-times <true/false> use relative X axis times, no will set absolute times
Aggregate all Rows into one True/False
Paint gradient background True/False
Paint markers paint markers
Paint zeroing lines paint zeroing lines
paint-markers <yes/no> paint markers on data points (since 1.1.3)
prevent-outliers <yes/no> prevent outliers on distribution graph
Limit number of points in row limit number of points in row
Force Y axis limit Force input value as Y axis limit
Low count limit hide points with sample count below input limit
success-filter <true/false/Undefined> filter samples by success flag (since 0.5.6), possible values are:

  • true: Only successful samples will be graphed
  • false : Only failing samples will be graphed
  • Undefined means no filtering on success flag will occur.
Include only samples Comma-separated list of samples to be graphed
Exclude samples Exclude from report samples with specified labels, comma-separated
Auto-Scale enable/disable auto-scale multipliers for perfmon/composite graph
line thickness for graph rows line thickness for graph rows

JMeter Setup:

JMeter-Plugin installation:

  • Use JMeter version >= 2.10
  • Download extras bundle and unzip it, copy lib/ext/JMeterPlugins-Extras.jar to <jmeter home>/lib/ext.
  • Restart jmeter.

JMeter Configuration:

Edit <jmeter home>/bin/user.properties and ensure you set these properties:

jmeter.save.saveservice.output_format=csv

jmeter.save.saveservice.data_type=false

jmeter.save.saveservice.label=true

jmeter.save.saveservice.response_code=true

jmeter.save.saveservice.response_data.on_error=false

jmeter.save.saveservice.response_message=false

jmeter.save.saveservice.assertion_results_failure_message=false

jmeter.save.saveservice.successful=true

jmeter.save.saveservice.thread_name=true

jmeter.save.saveservice.time=true

jmeter.save.saveservice.subresults=false

jmeter.save.saveservice.assertions=true

jmeter.save.saveservice.latency=true

jmeter.save.saveservice.bytes=true

jmeter.save.saveservice.hostname=true

# This will enable correct graphs display 

# which deal with threads after reloading the results file.

jmeter.save.saveservice.thread_counts=true

jmeter.save.saveservice.sample_count=true

jmeter.save.saveservice.timestamp_format=HH:mm:ss

jmeter.save.saveservice.default_delimiter=;

jmeter.save.saveservice.print_field_names=true

# This is needed to ensure all results are 

# available when Listener runs

jmeter.save.saveservice.autoflush=true

Test Plan setup:

If using distributed testing, ensure you add to your Thread Group names:

${__machineName()}_My Threadgroup name

Test Plan example:

We will use a test plan you can easily create with Templates…> Building a Web Test Plan

We just added an Http Cookie Manager and removed Graph Results listener.

We end up with this, the only listener is the new jp@gc Graphs Generator

Let’s run plan:

Now run this plan in NON-GUI mode as per JMeter Best-Practices using following command-line:

./jmeter -t GraphsReportListener-GenerationAtEndOfTestNonGUI.jmx -n

  -l /data/jmeter/test-results.csv

 -JTEST_RESULTS_FILE=/data/jmeter/test-results.csv

Notice the following:

  1. -t GraphsReportListener-GenerationAtEndOfTestNonGUI.jmx : Means use following jmx file GraphsReportListener-GenerationAtEndOfTestNonGUI.jmx
  2. -n : Means NON GUI
  3. -l /data/jmeter/test-results.csv : Means output results in following file
  4. -JTEST_RESULTS_FILE=/data/jmeter/test-results.csv : Notice we set the same value as output file in 3). We set this because in “jp@gc Graphs Generator” we have used __P function in JMeter to replace TEST_RESULTS_FILE by the value we input in -J:
    • ${__P(TEST_RESULTS_FILE,/data/jmeter/test-results.csv)}

In this configuration, notice we have decided to only include 2 samples:

  • Home Page
  • Changes

In a real worl scenario, you would use Transaction Controller for meaningful transaction names and only include those in your report.

Results:

At end of test JMeter automatically generated in <jmeter home>/bin folder the following files:

Graphs:

Response Times over time:

Hits Per Second:

Bytes throughput over time:

Latencies over time:

Response codes per second:

Response times distribution:

Response times percentiles:

Threads state over time:

Time vs Threads:

Transactions per second:

Throughput vs Threads:

Other Features

Graphs Generator Listener can also generate CSV files besides PNG files.

Graph Generator Listener can even generate graphs for existing results, to do so, create a fake plan like the following:

Run it in GUI or NON-GUI mode, the graphs will be generated.

Ensure you use the same properties configuration you used during the test that generated the results you are graphing.

NDLR:

With this new Graphs Generator Listener , you can now easily:

  • Generate meaningful and sexy graphs at the end of your test
  • Generate meaningful and sexy graphs for existing results any time you want
  • Output CSVs with computed datas at end of your test if you want to use custom graphs
  • Output CSVs with computed datas for existing results any time you want if you want to use custom graphs

About author:

Philippe Mouawad is a developer, committer and member of the JMeter Project Management Committee at Apache.

He is also the co-author of the book Master JMeter : from load testing to DevOps

Automatically generating nice graphs at end of your Load Test with Apache JMeter and JMeter-Plugins的更多相关文章

  1. Jmeter3.0新特性

    2016-5-19昨日,Jmeter又更新了新版本. 那么新版本有哪些新特性呢? Changes   This page details the changes made in the current ...

  2. ARTIFICIAL INTELLIGENCE FOR GAMES (Ian Millington / John Funge 著)

    相关网站:http://www.ai4g.com PART I AI AND GAMESCHAPTER1 INTRODUCTIONCHAPTER2 GAME AIPART II TECHNIQUESC ...

  3. Python equivalent of D3.js

    http://brandonrose.org/       Python equivalent of D3.js Ask Question Asked 7 years, 1 month ago Act ...

  4. P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1

    P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1       May ...

  5. Free Slideshow, Gallery And Lightboxes Scripts

    http://bootstraphelpers.codeplex.com/SourceControl/list/changesets https://github.com/gordon-matt/Bo ...

  6. windows 下使用 zip安装包安装MySQL 5.7

    以下内容参考官方文档:http://dev.mysql.com/doc/refman/5.7/en/windows-start-command-line.html 解压缩zip到D:\mysql-5. ...

  7. Ubuntu环境下Hadoop1.2.1, HBase0.94.25, nutch2.2.1各个配置文件一览

    /×××××××××××××××××××××××××××××××××××××××××/ Author:xxx0624 HomePage:http://www.cnblogs.com/xxx0624/ ...

  8. yarn源代码

    Modules-------YARN consists of multiple modules. The modules are listed below as per the directory s ...

  9. springboot 注册dao层 service 层

    可以使用三种注解来引入DAO层的接口到spring容器中.1.@Mapper,写在每一个DAO层接口上,如下: 2.@MapperScan和@ComponentScan两者之一.前者的意义是将指定包中 ...

随机推荐

  1. IDEA-相关插件使用

    IDEA日常开发中,整理一些用到的插件,以便后续使用起来方便. 点击File-Settings->Plugins. 1.进度条-彩虹,搜索Nyan字样,如图所示(本人已安装),点击Install ...

  2. web开发——文件的上传和下载

    众所皆知,web上传大文件,一直是一个痛.上传文件大小限制,页面响应时间超时.这些都是web开发所必须直面的. 本文给出的解决方案是:前端实现数据流分片长传,后面接收完毕后合并文件的思路. 实现文件夹 ...

  3. 1-移远GSM/GPRS M26 模块 Mini板 开发板(使用说明)

    板子预览 引脚说明 供电 关于串口电压匹配引脚: 上面一版朋友测试反应的问题 (上面的内容不删除,因为已经出售了1套) 1,源码开发完以后,烧录完成 PWRKEY按键不能使用了,需要断电上电,那么就需 ...

  4. 【JZOJ6225】【20190618】计数

    题目 对于一个01串,定义\(f(s)\)为\(f(s) = \sum_{i=0}^{\lfloor \frac{|s|}{2} \rfloor -1 }[s_i=s_{|s|-1-i}]\) 定义\ ...

  5. gulp+webpack多页应用开发,webpack仅处理打包js

    项目背景:一个综合网站,开发模式为后端嵌套数据,前端开发静态页面和部分组件. 问题:gulp任务处理自动刷新.sass编译等都是极好的.但是对于js的处理并不是很好,尤其是项目需要开发组件时候,如评论 ...

  6. 不能对以下表使用 TRUNCATE TABLE

    1.由 FOREIGN KEY 约束引用的表.(您可以截断具有引用自身的外键的表.) 2.参与索引视图的表. 3.通过使用事务复制或合并复制发布的表. 4.对于具有以上一个或多个特征的表,请使用 DE ...

  7. GitHub如何删除一个代码仓库

    进入GitHub之后,点击“your repositories”查看所有的代码仓库. 在代码仓库中选择一个需要删除的,进入其详情页 在详情页中找到“setting”设置,下拉至最后可以看到删除选项. ...

  8. win7企业版激活

    win7企业版激活:(亲测有效) 打开命令提示符,依次执行下面的代码,分别表示:安装win7企业版密钥,设置kms服务器,激活win7企业版,查询激活期限,kms一般是180天,到期后再次激活. sl ...

  9. Monkey框架(测试方法篇) - monkey日志分析

    Monkey日志分析是Monkey测试中非常重要的一个环节,通过日志分析,可以获取当前测试对象在测试过程中是否会发生异常,以及发生的概率,同时还可以获取对应的错误信息,帮助开发定位和解决问题.介绍日志 ...

  10. #C++初学记录(算法效率与度量)

    时间性能 算法复杂性函数: \[ f(n)=n^2 +1000n+\log_{10}n+1000 \] 当n的数据规模逐渐增大时,f(n)的增长趋势: 当n增大到一定值以后,计算公式中影响最大的就是n ...