Jmeter plug-in PerfMon Metrics Collector installation and use and error resolution

As a lightweight performance testing tool, Jmeter is more and more popular with testers due to its open source, compact and flexible features. In actual projects, especially cross-regional projects, Jmeter will be the first choice unless the partner specifies that Loadrunner should be used as a performance testing tool.

This article focuses on the installation and use of the Jmeter server performance monitoring plug-in PerfMon Metrics Collector and the solutions to problems encountered during use.

Download and install Jmeter plugin

You may have questions, why not install PerfMon Metrics Collector? If you search the Jmeter plug-in on the Internet, you will find that most of them are how to install a certain plug-in. However, there may be various problems in the actual installation, but few people answer them. In fact, as long as the Jmeter plug-in package is completely installed, You can use it however you want.

Download address: https://jmeter-plugins.org/install/Install/, the download interface is as follows:

Plug-in installation: The downloaded file is in plugins-manager.jar format, put it in the \lib\ext directory under the Jmeter installation directory, and then restart Jmeter.

Server plug-in download and configuration

To use PerfMon Metrics Collector, you also need a plug-in ServerAgent (those who need the plug-in can ask for it from Tiantianquan).

Knock on the blackboard: Do not decompress the compressed package locally, it is not used locally, put the entire compressed package on the server!

If the server is a Linux environment:

Execute the command: cd /usr/bin, use Xftp to upload ServerAgent-2.2.1.rar to /usr/bin of the server;

Execute the command: unrar -e ServerAgent-2.2.1.rar to decompress the compressed package;

Execute the command: rm -rf ServerAgent-2.2.1.rar to delete the original compressed package;

Execute the command: cd ServerAgent-2.2.1 to enter the ServerAgent-2.2.1 directory;

Execute the command: chmod 777 startAgent.sh, set startAgent.sh as an executable file;

Execute the command: sh startAgent.sh to start the Agent service;

Execute the command: nohup ./startAgent.sh & to put the Agent service in the background without suspending it.

If the server is in a Windows environment, decompress the compressed package ServerAgent-2.2.1.rar, and run startAgent.bat directly. If the following picture appears, it means that the activation is successful:

The PerfMon Metrics Collector plugin uses

1. Plug-ins added

Open Jmeter, adjust the script according to the project requirements, and finally add various monitoring.

 Host/IP: The address of the server to be monitored

 Port: default port

Metric to collect: monitor resource configuration items

Add Row, Copy Row, Delete Row: Corresponding to Add button, Copy button, Delete button respectively

Chart: the graph shows the main interface

Rows: small graph interface and the colors represented by different resource curves

Settings: Settings

2. Monitoring usage strategy

If the test execution time of the test scenario is long and the amount of monitoring data collected is relatively large, in order to view the graph in GUI mode more conveniently and quickly, it is recommended to use a PerfMon listener for each monitoring indicator item to configure different indicator items The data is stored in different files, and after the test is executed, loading and viewing the data will be faster.

If the amount of data is not expected to be too large, you can divide the PerfMon listener by server. In this way, it is convenient to observe the change trend of the resource usage of a certain server during the whole test process.

For distributed services, in order to facilitate the observation of the load distribution and load change trend of each node, you can consider placing the same type of nodes in the same PerfMon listener for comparison and observation.

3. Curve value

When a PerfMon listener displays the data of various indicator items, for the observability of the graph, the plug-in will automatically optimize: the displayed value will be enlarged on the real value collected. The purpose is to ensure that various trends can be observed when different data items are displayed in the same coordinate system.

4. Curve settings

Use relative times: Used to configure the x-axis of the graph to represent relative time (0 at the beginning of the test) or the actual system time Auto-zoom rows for best fit: If checked, there will be the display data mentioned above when talking about the value of the graph Automatic zoom-in function, if unchecked, all the actual values ​​collected will be displayed. Limit number of points in row to XX points: After checking, you can set the number of sampling points displayed in the graph. Our test reports will be viewed by different roles. Some of these roles may not have or require a detailed understanding of monitoring data.

At this time, the monitoring graph we provide should be easy to read. If the graph is rendered according to all the actual sampling points, there may be a lot of noise data that deviates from the trend, which may be confusing to those who do not understand , so when we have the analysis conclusion and the final report is presented, we can consider adjusting the sampling points to make the graph better show the resource usage trend and eliminate other unnecessary information.

Force maximum Y axis value to XX: If it is not checked, the plug-in will automatically adjust the maximum value of the Y axis according to the value when drawing the graph to achieve better readability.

Graph Options: Graph options, control the width of the graph and draw markers.

The following shows you the monitoring results of a certain project:

Solutions to problems that may be encountered during the use of the PerfMon Metrics Collector plug-in

1. Always report error ERROR: java.net.ConnectException: Connection refused: connect

a. Check whether the ServerAgent is normally enabled on the server

b. Is the firewall on the server closed?

c. Whether the default port is occupied

If it is determined that the port is occupied, run java -jar ./CMDRunner.jar --tool PerfMonAgent --udp-port 7777 --tcp-port 7777 in the statAgent directory to change the default port.

2. Error java.lang.NoSuchMethodError: org.apache.jmeter.samplers.SampleSaveConfiguration.setFormatter(Ljava/text/DateFormat;)

This error is reported because the JMeter version used is too high and does not support the jp@gc - PerfMon Metrics Collector plug-in. You can download a lower version of JMeter, such as Jmeter3.1.

Finally: I have compiled a complete software testing video learning tutorial for you. If you need it, you can get it for free 【保证100%免费】

 

                                How to obtain the full set of materials: Click the small card below to get it yourself

                                                          

Guess you like

Origin blog.csdn.net/NHB456789/article/details/131141896