JMeter has many listeners which provide useful information like each request’s response time, number of the requests processed, response data, throughput, error%, etc. but actually we would like to know the utilization of server system resource, like CPU/Memory utilization. The ServerAgent can collect the server performance metrics, and one JMeter plugin can provide a visual report to us.
The ServerAgent will open the port 4444 by default and start a thread to listen all data on the server machine, and it also allows the external system to read the listened data and the JMeter plugin jp@gc – PerfMon Metrics Collector can listen to the ServerAgent on the server.
Here are steps to monitor the server performance metrics:
- Go to http://jmeter-plugins.org/downloads/all/ and download the latest release of JMeterPlugins-Standard-1.3.1.zip, ServerAgent-2.2.1.zip and JMeterPlugin-Extras-1.3.1.zip
- Unzip the JMeterPlugins-Standard-1.3.1.zip and JMeterPlugin-Extras-1.3.1.zip and copy JMeterPlugins-Extras.jar and JMeterPlugins-Standard.jar under %JMETER_HOME%\lib\ext
- Upload the ServerAgent-2.2.1.zip to the server you want to monitor, Unzip ServerAgent-2.2.1.zip and start startAgent.sh. It will launch the default port 4444 and the following message is displayed.
- Launch Jmeter.bat, right click Test plan – > listener, you will see a lot of Listeners/Reports which start with “jp@gc” are available now.
- Add jp@gc – PerfMon Metrics Collector under your Test Plan, and add the server Host/IP and Port, choose the metric to collect, see below:
- Host/IP –> Host or IP address of the server where the ServerAgent runs.
- Port –> Port through which listener can talk to ServerAgent.
- Metric to Collect –> CPU, Memory, Disks I/O…etc. It is a drop down. Select the metric you want to monitor
- Metric Parameter –> Specific parameter in case of any for the Metric. For example, if we need to collect the metric for a specific process, add the process Identifier. For ex: pid=4448
- Now everything is ready and clicks Run to start the JMeter test, you can see the server’s CPU and Memory utilization have been collected.
Right click on the chart, you can save the chart as an image or export the result to a CSV file.