JMeterPluginsCMD Command Line Tool since 0.4.1
There is small command-line utility for generating graphs out of JTL files. It behave just like right-click context menu on all graphs. The tool can generate PNG, CSV or both.
Installation
The tool is placed inside distribution ZIP. The tool consists of CMDRunner.jar and shell wrappers. Wrappers just shorten call of "java -jar CMDRunner.jar --tool Reporter ...". The tool files must be placed inside lib/ext directory of JMeter installation. The tool requires JMeterPlugins.jar to be placed in lib/ext also. The tool requires JMeter 2.4 to function properly (2.3 will work only for PNG generation).
Usage and Parameters
Generating PNG:
java -jar CMDRunner.jar --tool Reporter --generate-png test.png --input-jtl results.jtl --plugin-type ResponseTimesOverTime --width 800 --height 600
Generating CSV:
java -jar CMDRunner.jar --tool Reporter --generate-csv test.csv --input-jtl results.jtl --plugin-type ResponseTimesOverTime
Yoy may generate CSV and PNG in single tool run. --help will show you short help list on available parameters.
| --generate-png <file> | generate PNG file containing graph |
| --generate-csv <file> | generate CSV file containing graph data |
| --input-jtl <file> | load data from specified JTL file |
| --plugin-type <class> | which type of graph use for results generation |
You may customize graph drawing and data processing like GUI settings do with optional parameters:
| --width <pixels> | for PNG only - width of the image, default is 800 |
| --height <pixels> | for PNG only - height of the image, default is 600 |
| --granulation <ms> | granulation time for samples |
| --relative-times <yes/no> | use relative X axis times, no will set absolute times |
| --aggregate-rows <yes/no> | aggregate all rows into one |
| --paint-gradient <yes/no> | paint gradient background |
| --paint-zeroing <yes/no> | paint zeroing lines |
| --prevent-outliers <yes/no> | prevent outliers on distribution graph |
| --limit-rows <num of points> | limit number of points in row |
| --force-y <limit> | force Y axis limit |
| --hide-low-counts <limit> | hide points with sample count below limit |
| --include-labels <labels list> | include in report only samples with specified labels, comma-separated |
| --exclude-labels <labels list> | exclude from report samples with specified labels, comma-separated |
| --auto-scale <yes/no> | enable/disable auto-scale multipliers for perfmon/composite graph |
| --line-weight <num of pixels> | line thickness for graph rows |
Plugin Type Classes
Most of class names are self-explanatory:
- AggregateReport = JMeter's native Aggregate Report, can be saved only as CSV
- ThreadsStateOverTime = Active Threads Over Time
- BytesThroughputOverTime
- HitsPerSecond
- LatenciesOverTime
- PerfMon = PerfMon Metrics Collector
- ResponseCodesPerSecond
- ResponseTimesDistribution
- ResponseTimesOverTime
- ResponseTimesPercentiles
- ThroughputOverTime
- ThroughputVsThreads
- TimesVsThreads = Response Times VS Threads
- TransactionsPerSecond
Can you add new attribute --LimitNumber?-points? (Settings -- Rendering Options Limit number of points in row 20--200 points). It is useful !!
Yes, I will try add it before release of 0.4.1
Hi, can you also let the tool use the graph settings in user.properties? I changed the default setting of the relative time to false and you like to use this in the tool as well.
Intersting discussion took place: http://jmeter.512774.n5.nabble.com/Automatic-generation-of-aggregate-reports-td4281459.html
Ok, I tried to implement all available graph options and user.properties. No snapshot yet for this changes...
Cool!
Next request off course is the possibility to automatically create a Word of PDF report with predefined graphs ;-)
Thanks a lot for sharing it with us
Sander! Could you become our next committer? You got a lot of energy inventing features, we need someone to implement all of them ;)
Just kiddin' of course! But more programmers for project would be great...
Very good command line tool. Could it support other kinds of Listeners type? like plugin-type: Aggregate Report
No, it can only support our custom plugins, because JMeter code have no way to get data from inside existing plugins.
However, there is a copy of AggregateReport? plugin type available for use in tool.
I tried to use the --aggregate-rows command and set it to yes, but the rows don't aggregate into one row :( and is there a way for the response time to be converted to seconds?
No, there is no way to convert response times to seconds since JMeter use milliseconds as response time units.
Could you post to newsgroup or create an issue for --aggregate-rows with full command-line example?
ok thanks
Hi,
jmeter.bat -n -t my_test.jmx -l log.jtl
Keep getting this error using the sh script on a linux box:
DEBUG 2011-05-04 16:35:24.808 [kg.apc.j] (): Creating jmeter env JMeter home directory was detected as: /mnt/msdaix14/Jmeter/jakarta-jmeter-2.4 Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at kg.apc.jmeter.cmd.NewDriver.main(NewDriver.java:183) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at kg.apc.jmeter.cmd.NewDriver.main(NewDriver.java:178) Caused by: java.lang.IllegalAccessError: tried to access method kg.apc.jmeter.vizualizers.AbstractGraphPanelVisualizer.getSettingsPanel()Lkg/apc/jmeter/vizualizers/JSettingsPanel; from class kg.apc.jmeter.PluginsCMDWorker at kg.apc.jmeter.PluginsCMDWorker.setOptions(PluginsCMDWorker.java:213) at kg.apc.jmeter.PluginsCMDWorker.doJob(PluginsCMDWorker.java:161) at kg.apc.jmeter.PluginsCMD.processParams(PluginsCMD.java:163) ... 5 morePlease, use Issues tab to report issues...
Can we get the composite graph with command line?
No, we can't. It is so difficult task to configure whole possible compound stuff... Maybe in the future we'll find a nice way to provide it.
Really nice and helpful stuff. Great job.
What would be also nice is a way to graph any sample element that would be present in the jtl file. It may be useful to handle customized variables added with the jmeter sample_variables property. For example, I am recording a results.count value that is a value extracted from every response and that gives a number of items returned by a request - similar to bytes but expressed in a "functional unit".
It could be seen as a generalization of the actual data (response time, latency, bytes...) that are currently available in graphs.
Thanks, this tool is very well built. It solves most of my doubts.
Hi
Could you please answer one of my questions.
I would like to run the load test on different remote servers, collect the report from all the server's and pass it as an input param to this commandline tool and can I expect a cumulative AggregrateReport??
To aggregate in command line 2 JTL files, you should use CSV and manually join them into one file.
I have also tried the --aggregate-rows yes command without successfull results. My command line example is: java -jar JMeterPluginsCMD.jar --generate-png tsot2.png --input-jtl "d:\20110722_120u5i_r4.jtl" --plugin-type ThreadsStateOverTime? --aggregate-rows yes --width 800 --height 600
This is an issue of 0.4.1: http://code.google.com/p/jmeter-plugins/issues/detail?id=39
when do you plan to release the fix for this bug? I tried JMeterPlugins-0.4.2-snapshot but it seems to break other graphs...
Break other graphs? It's important bug, could you file an issue with more details how they're broken?
I've created issue 64 to work with your case
Could it also be possible to import a csv file as data?
Yes, it is possible, but only if you have the same saveservice.properties and jmeter.properties at load generator and cmd tools machine.
Hello and thank you for this good plugins.
When generating png, is it possible to select some rows ?
Best regards
Currently no, it is planned for future versions.
This page needs to be updated. As of 0.5.0 there is no cmd directory. You now need to use the CMDRunner.jar but also pass in --tool Reporter to generate any png or csv
Thanks for noticing, I changed the page
Hi!
Please I need help, how to use this plugin in order to generate results through non-gui run. I have configured everything and still I couldn't generate a graph for this job.
any one?
I have to detail that I am talking about "Perfmon Metrics Collector" plugin.
Well, you should set up saving PerfMon data into file first (make this in Collector's GUI) Then you may use CMD tool to generate results from that file.
Hi again ,
I have used this command: -c "/usr/bin/java -jar /monsoon/opt/JMeter/lib/ext/JMeterPluginsCMD.jar --generate-png ./results/PerfmonMetricsCollector?.png --input-jtl ./results/mmcp_create_project.jtl --plugin-type PerfmonMetricsCollector? --width 1024 --height 768"
Still I have no results from server agent.
Could you create an issue, attach your JTL to it and describe your commands there? I'll take a look.
Would it be possible to add an option to output a tab delimetde file? We are running automated tests and using this tool to generate a CSV of the Aggregate Report. We then email the csv file to different teams. It would be nice to have a nicely formatted tab delimeted file.
Ok, I added item on separator setting to Roadmap
I got this error message i dont know very is problem, Java 1.6 update 17, Jmeter 2.6, plugin 0.51
C:\Programy\jmeter-2.6\lib\ext>java -jar CMDRunner.jar --tool Reporter --generat e-png test.png --input-jtl "C:\Program\jmeter-2.6\logs\web_ResponseTimesOver?? Time_20120214_20120214-122333.jtl" --plugin-type ResponseTimesOverTime --width 800 --height 600 DEBUG 2012-02-14 14:12:20.719 [kg.apc.j] (): Creating jmeter env using JMeter home: C:\Program\jmeter-2.6 ERROR: java.lang.NoSuchMethodError??: org.apache.jorphan.util.JOrphanUtils.closeQu ietly(Ljava/io/InputStream??;)V Problem's technical details go below Home directory was detected as: C:\Program\jmeter-2.6\lib\ext Exception in thread "main" java.lang.NoSuchMethodError??: org.apache.jorphan.util. JOrphanUtils.closeQuietly(Ljava/io/InputStream??;)V
java:104) at kg.apc.jmeter.PluginsCMDWorker.prepareJMeterEnv(PluginsCMDWorker.java :69) at kg.apc.jmeter.PluginsCMDWorker.<init>(PluginsCMDWorker.java:43) at kg.apc.cmdtools.ReporterTool??.processParams(ReporterTool??.java:58) at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:63) at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:23) at sun.reflect.NativeMethodAccessorImpl??.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl??.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl??.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at kg.apc.cmd.UniversalRunner??.main(UniversalRunner??.java:149)See issue 124 . And please, don't use comments as issues.