I'm using the perfmon plugin within JMeter to collect stats like CPU usage and would like to display this in a custom (over time) graph in the standard JMeter HTML report.
So far I have a custom graph which allows me to display any variable I like from the test script. However the problem seems to be that I can't pass samples from the perfmon collector to a variable in order to get them on the graph.
I suspect the problem may be that the custom graphs are geared around using a SAMPLER, whereas the perfmon plugin is a LISTENER.
I realise the perfmon listener can also output to a CSV file but isn't there a way to extract values from the perfmon listener which would facilitate usage on a custom graph?
Is there another way to sample the CPU usage which makes the information available to custom graphs in the HTML report?
It looks like your colleague has asked the identical question yesterday
Add the next lines to user.properties file:
Add JSR223 Listener to your Test Plan and put the following code there:
This way when a Sample occurs the JSR223 Listener will query the Server Agent for CPU usage and store the value into
cpuvariable. The variable values for each Sampler will be added to the .jtl results file and you will be able to plot them over your test execution time span.More information: