Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a 'Median' field to the dashboard and make the response time percentile fields support floating-point numbers #567

Merged

Conversation

keithmork
Copy link
Contributor

@keithmork keithmork commented Mar 19, 2020

Description

The goal is to make the dashboard behave closer to the aggregate report listener.

The aggregate report listener supports floating-point numbers like 99.9, 99.99, 99.999 ... in aggregate_rpt_pctX properties. Since the StatisticsSummaryConsumer reads exactly the same properties, it's reasonable to change the percentiles from int to double. Users should expect to see the same fields regardless of in which mode they start JMeter, GUI or command line.

For the same reason, the 'missing' Median field is added.

Motivation and Context

For online shopping sites/apps, it's essential to know the 99.9...th percentile of response time, as there may be thousands or millions of concurrent requests during the sales/promotion campaigns.

And median (50th pct) can describe the distribution of response times better than average, as it isn't a normal distribution.

How Has This Been Tested?

  • The changes don't break any unit test on my macbook (macOS 10.15.1)
  • Looks ok with the new and modified fields both in the HTML dashboard and in the statistics.json
  • Set aggregate_rpt_pctX to 90, 95 and 99, the result is the same as JMeter 5.2.1
  • Set aggregate_rpt_pct3 to 100, the value of 100th percentile equals to the Max field

Data:
https://github.com/keithmork/hugo-blog/blob/master/static/file/pull-request/jmeter/20190319_kpi.jtl.zip

Command:

rm -rf /path/to/dashboard

JVM_ARGS="-Xmx2g" ./bin/jmeter -g "/path/to/kpi.jtl" \
 -o "/path/to/dashboard" -j "/path/to/generate_report.log" \
 -Jjmeter.reportgenerator.overall_granularity=5000 \
 -Jjmeter.reportgenerator.statistic_window=-1 \
 -Jaggregate_rpt_pct1=99.9 \
 -Jaggregate_rpt_pct2=99.99 \
 -Jaggregate_rpt_pct3=99.999

open /path/to/dashboard/index.html

Screenshots (if appropriate):

dashboard index

response time percentiles over time graph

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.

@keithmork keithmork closed this Apr 8, 2020
@keithmork keithmork reopened this Apr 8, 2020
@codecov-io
Copy link

codecov-io commented Apr 8, 2020

Codecov Report

Merging #567 into master will increase coverage by 0.00%.
The diff coverage is 93.47%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #567   +/-   ##
=========================================
  Coverage     55.33%   55.34%           
- Complexity     9959     9966    +7     
=========================================
  Files          1032     1032           
  Lines         63343    63358   +15     
  Branches       7157     7157           
=========================================
+ Hits          35051    35064   +13     
- Misses        25816    25819    +3     
+ Partials       2476     2475    -1     
Impacted Files Coverage Δ Complexity Δ
.../main/java/org/apache/jmeter/util/JMeterUtils.java 52.29% <25.00%> (-0.30%) 73.00 <1.00> (+1.00) ⬇️
...g/apache/jmeter/report/dashboard/JsonExporter.java 88.13% <100.00%> (+0.20%) 6.00 <0.00> (ø)
...che/jmeter/report/dashboard/SamplingStatistic.java 100.00% <100.00%> (ø) 29.00 <2.00> (+2.00)
...er/report/processor/StatisticsSummaryConsumer.java 96.29% <100.00%> (-0.09%) 13.00 <2.00> (+1.00) ⬇️
...jmeter/report/processor/StatisticsSummaryData.java 82.14% <100.00%> (+0.66%) 24.00 <1.00> (+1.00)
.../ResponseTimePercentilesOverTimeGraphConsumer.java 100.00% <100.00%> (ø) 10.00 <4.00> (+1.00)
...n/java/org/apache/jmeter/reporters/Summariser.java 85.49% <0.00%> (+0.76%) 18.00% <0.00%> (+1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7897df5...a031d57. Read the comment docs.

@keithmork keithmork closed this Apr 13, 2020
@keithmork keithmork reopened this Apr 13, 2020
@keithmork keithmork force-pushed the dashboard-add-median-and-fix-percentiles branch from 76c6b9a to a031d57 Compare April 13, 2020 10:09
@pmouawad pmouawad merged commit 9a8ca62 into apache:master Apr 26, 2020
kkalinin pushed a commit to kkalinin/jmeter that referenced this pull request Mar 11, 2021
…entile fields support floating-point numbers (apache#567)

* add median field and fix percentiles
* fix imports
* fix style

Contributed by Keith Mo keithmork
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants