Bug 63059 - Create a new JsonExporter that exports as JSON the content of data computed for HTML Dashboard Statistics table
Summary: Create a new JsonExporter that exports as JSON the content of data computed f...
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 5.0
Hardware: All All
: P2 enhancement (vote)
Target Milestone: JMETER_5.1
Assignee: JMeter issues mailing list
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2019-01-06 22:40 UTC by Philippe Mouawad
Modified: 2019-01-07 13:29 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Mouawad 2019-01-06 22:40:07 UTC
I think there is a need to export as JSON the data computed by HTML Report generator.

For example, in jmeter-maven-plugin, it would be nice to have Failure criterion rules and I don't want to recompute the same data that are already done by JMeter.
But I guess there are many other use cases:

- Jenkins plugin that would historize those datas
- Users wanting to render those data differently
...


To do that, we can create a new JSONExtractor that extends AbstractDataExporter.
It would be configured this way:
# JSON Export 
jmeter.reportgenerator.exporter.json.classname=org.apache.jmeter.report.dashboard.JSONExporter


It would generate a file statistic.json with this format:

[ {
  "transaction" : "Total",
  "sampleCount" : 3749,
  "errorCount" : 0,
  "errorPct" : 0.0,
  "meanResTime" : 229.63,
  "minResTime" : 100.0,
  "maxResTime" : 360.0,
  "pct1ResTime" : 331.0,
  "pct2ResTime" : 344.0,
  "pct3ResTime" : 354.0,
  "throughput" : 31.21,
  "receivedKBytesPerSec" : 0.0,
  "sentKBytesPerSec" : 0.0
}, {
  "transaction" : "JR1",
  "sampleCount" : 3749,
  "errorCount" : 0,
  "errorPct" : 0.0,
  "meanResTime" : 229.63,
  "minResTime" : 100.0,
  "maxResTime" : 360.0,
  "pct1ResTime" : 331.0,
  "pct2ResTime" : 344.0,
  "pct3ResTime" : 354.0,
  "throughput" : 31.21,
  "receivedKBytesPerSec" : 0.0,
  "sentKBytesPerSec" : 0.0
} ]


I have nearly completed implementation, we would require those additional jars:
- jackson-annotations-2.9.8.jar
- jackson-core-2.9.8.jar
- jackson-databind-2.9.8.jar
Comment 1 Philippe Mouawad 2019-01-07 11:15:36 UTC
Author: pmouawad
Date: Mon Jan  7 11:15:03 2019
New Revision: 1850626

URL: http://svn.apache.org/viewvc?rev=1850626&view=rev
Log:
Bug 63059 - Create a new JSonExporter that exports as JSON the content of data computed for HTML Dashboard Statistics table

Contributed by UbikLoadPack (https://ubikloadpack.com)
Bugzilla Id: 63059

Added:
    jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/JsonExporter.java   (with props)
    jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/SamplingStatistic.java   (with props)
Modified:
    jmeter/trunk/LICENSE
    jmeter/trunk/bin/reportgenerator.properties
    jmeter/trunk/build.properties
    jmeter/trunk/build.xml
    jmeter/trunk/eclipse.classpath
    jmeter/trunk/lib/   (props changed)
    jmeter/trunk/lib/aareadme.txt
    jmeter/trunk/res/maven/ApacheJMeter_parent.pom
    jmeter/trunk/xdocs/changes.xml
Comment 2 Philippe Mouawad 2019-01-07 13:28:54 UTC
Author: pmouawad
Date: Mon Jan  7 13:26:29 2019
New Revision: 1850638

URL: http://svn.apache.org/viewvc?rev=1850638&view=rev
Log:
Bug 63059 - Create a new JSonExporter that exports as JSON the content of data computed for HTML Dashboard Statistics table

Fix test failure, we need to have 1 version property per variant of jackson library
Bugzilla Id: 63059

Modified:
    jmeter/trunk/res/maven/ApacheJMeter_parent.pom
    jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java