Jmeter-based RSF performance testing method

CN116382989BActive Publication Date: 2026-07-21JIANGSU SUNING BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGSU SUNING BANK CO LTD
Filing Date
2023-03-28
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

而现在常用的性能测试工具如Jmeter、loadrunner或者一些商用的压测平台,都无法直接支持RSF的调用,只能通过人工编写java代码来实现RSF框架的调用,这对于想通过Jmeter来进行接口测试或者性能测试且没有代码功底的测试人员来说很不友好,需要花费大量的学习成本;同时,对于每次RSF请求的压测需求需要重新开发压测脚本,会造成重复的劳动

Benefits of technology

[0031]有益效果:本发明通过开发出适用于RSF的Jmeter的插件,该插件只需要配置对应的参数和报文,并对指定的报文内容进行参数化,就可以直接将RSF请求发送到对应的服务器,同时接收服务器返回的测试结果并进行自动校验,极大的减少了测试人员重复编写JAVA代码的时间,减少了手工拼写报文内容的时间,同时降低了测试人员的学习成本,测试人员无需编写复杂的java代码,只需要配置简单的参数和报文即可进行RSF的接口和性能测试。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116382989B_ABST
    Figure CN116382989B_ABST
Patent Text Reader

Abstract

The application discloses a kind of RSF performance test methods based on Jmeter.The method includes developing Jmeter plug-in;Set the basic data of request message;Determine whether the format of request message meets the requirements, and if not, carry out request message format conversion;The content of request message is converted into the message type set;The converted request message is sent to the server registered by remote service framework RSF;Response message returned by the server is received, and the received response message is checked, if the response message meets the expectation, this request is set as success, otherwise, this request is set as failure;Using the performance statistical tool of Jmeter, the number of transactions per second and transaction response time analysis are carried out according to the received response message, and success rate analysis is carried out according to the checking result, and then the analyzed content is displayed.The application greatly reduces the test time, and reduces the learning cost of test personnel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more specifically to an RSF performance testing method based on JMeter. Background Technology

[0002] With the continuous development of information technology and the increasing number of users, the architecture of banking systems is becoming more and more complex, business scenarios are becoming more diversified, distributed application scenarios are becoming more widespread, and RPC technology is becoming more mature.

[0003] Suning's Remote Service Framework (RSF) is dedicated to solving service invocation problems between systems, providing a transparent and high-performance RPC service invocation solution. Currently applied in various systems, it is Suning's most widely used technology component, and most back-end services in banks utilize the RSF framework. Therefore, there are many performance testing scenarios that directly use RSF requests. However, commonly used performance testing tools such as JMeter, LoadRunner, or some commercial load testing platforms do not directly support RSF calls. These tools require manual Java code writing to implement RSF framework calls, which is very unfriendly to testers who want to perform interface or performance testing using JMeter but lack coding skills, requiring a significant learning curve. Furthermore, each load testing requirement for an RSF request necessitates the development of a new load testing script, resulting in repetitive work. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of existing technologies by providing a Jmeter-based RSF performance testing method.

[0005] To achieve the above objectives, this invention provides an RSF performance testing method based on JMeter, comprising:

[0006] Step 1: Develop a JMeter plugin to invoke request messages from the remote service framework RSF;

[0007] Step 2: In the sampler interface of the JMeter plugin, set the basic data for the Remote Service Framework (RSF) request message;

[0008] Step 3: Determine whether the request message of the remote service framework RSF is in JsonString format. If not, convert the request message of the remote service framework RSF into JsonString format.

[0009] Step 4: Input the content of the request message in JsonString format into the request message text box of the JMeter plugin to convert the request message into the set message type;

[0010] Step 5: Send the transformed request message to the server registered with the Remote Service Framework (RSF);

[0011] Step 6: Receive the response message returned by the server and verify the received response message. If the response message meets expectations, mark the request as successful; otherwise, mark the request as failed.

[0012] Step 7: Use JMeter's built-in performance statistics tool to analyze the number of transactions per second and transaction response time based on the received response messages, and analyze the success rate based on the verification results. Then, display the analyzed content.

[0013] Furthermore, the basic data includes service contract, implementation code, method name, and message type.

[0014] Furthermore, when a request fails, the JMeter window displays the specific exception information and serial number.

[0015] Furthermore, step 1 specifically includes:

[0016] 1.1 Create a Maven project and import the necessary dependencies, including ApacheJMeter_core, ApacheJMeter_java, and RSF;

[0017] 1.2. Develop and create an RSFSamplerUI class, which inherits from the parent class.

[0018] The `org.apache.jmeter.samplers.gui.AbstractSamplerGui` class is used to design and layout the user interface by overriding its parent class. Specifically, this includes:

[0019] (1) Load the data in the Sampler into the interface using configure;

[0020] (2) Create a new Sampler using createTestElement(), and then set the data from the interface into this new Sampler instance;

[0021] (3) Specify a fixed name using getStaticLabel;

[0022] (4) Define five configuration parameters in RSFSamplerUI, namely the service contract, implementation code, method name, message type input box type, and message content input box type;

[0023] 1.3 Develop the data processing module, as detailed below:

[0024] (1) Create getter / setter methods corresponding to the parameters in the RSFSamplerUI class for data exchange with the interface;

[0025] (2) Write message conversion code to achieve automatic conversion of message types;

[0026] 1.4 Develop the RSF Sampler module as follows: Create the RSFSampler class, inheriting from the parent class org.apache.jmeter.samplers.AbstractSampler, and override the SampleResult sample(Entry arg0) method. This allows Jmeter to initiate requests to the target system, including registering and calling the RSF service contract, calling the RSF interface, displaying sampler request data, and verifying whether the response message meets expectations. If the verification response message meets expectations, call setSuccessful(true) to indicate that the request was successful; if the verification response message does not meet expectations, call setSuccessful(false) to indicate that the request failed, and call setResponseData(output.toString(),"utf-8") to display the error information; when the verification response message is empty or other exceptions occur, also call setSuccessful(false) in the catch method to indicate that the request failed, and call setResponseData(e.toString()) to display the exception information.

[0027] 1.5 Package the above implementation into a JAR file and place it in the corresponding ext folder of JMeter.

[0028] Furthermore, the input field type for the message type is set to JLabeledTextField, and the input field type for the message content is set to JSyntaxTextArea.

[0029] Furthermore, the message types include JsonObject and Map types.

[0030] Furthermore, checkpoints are pre-set using JMeter's assertion functionality, and the received response messages are validated based on the content of the checkpoints.

[0031] Beneficial effects: This invention develops a JMeter plugin suitable for RSF. This plugin only requires configuring the corresponding parameters and messages, and parameterizing the specified message content, to directly send RSF requests to the corresponding server. At the same time, it receives the test results returned by the server and performs automatic verification. This greatly reduces the time testers spend repeatedly writing Java code and manually spelling message content. It also lowers the learning cost for testers. Testers do not need to write complex Java code; they only need to configure simple parameters and messages to perform RSF interface and performance testing. Attached Figure Description

[0032] Figure 1 This is a flowchart illustrating the RSF performance testing method based on Jmeter according to an embodiment of the present invention. Detailed Implementation

[0033] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. These embodiments are implemented based on the technical solutions of the present invention, and it should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention.

[0034] like Figure 1 As shown, this embodiment of the invention provides an RSF performance testing method based on JMeter, including:

[0035] Step 1: Develop a JMeter plugin to call RSF (Remote Service Framework) request messages. This plugin can send RSF request messages to the servers it is registered with.

[0036] Step 2: In the JMeter plugin interface, set the basic data for the Remote Service Framework (RSF) request message. This basic data includes the service contract, implementation code, method name, and message type.

[0037] Step 3: Determine if the request message format of the remote service framework RSF is JSONString. If not, convert the request message to JSONString format. If the request message format of the remote service framework RSF is already JSONString, no conversion is needed.

[0038] Step 4: Input the request message content in JSONString format into the request message text box of the JMeter plugin to convert the request message into the specified message type. The message types mentioned above include JsonObject and Map. If the message type requirement is JsonObject, Map, etc., it will be automatically converted using the JSON.parseObject method; if the message type requirement is a custom object, it will first convert the message to a Map type using the JsonUtil.jsonToBean method, and then convert it to the specified object type using BeanUtil.map2Bean.

[0039] Step 5: Send the transformed request message to the server registered with the Remote Service Framework (RSF). Multi-threading can be used to concurrently send the request message.

[0040] Step 6: Receive the response message returned by the server and validate it. If the response message meets expectations, mark the request as successful; otherwise, mark the request as failed. Specifically, you can use an IF statement to check whether the response message meets expectations, or you can use JMeter's assertion function to pre-set checkpoints and validate the received response message based on the checkpoint content.

[0041] Step 7: Use JMeter's built-in performance statistics tool to analyze the transactions per second (TPS) and transaction response time based on the received response messages, and analyze the success rate based on the verification results. Then, display the analyzed content.

[0042] Step 1 above specifically includes:

[0043] 1.1 Create a Maven project and import the necessary dependencies, including ApacheJMeter_core, ApacheJMeter_java, RSF, etc.

[0044] 1.2. Create an RSFSamplerUI class that inherits from the parent class.

[0045] `org.apache.jmeter.samplers.gui.AbstractSamplerGui` is the unified parent class for implementing the JMeter interface. It achieves interface design and layout by overriding the parent class, specifically including:

[0046] (1) Load the data from the Sampler into the interface using configure. Before customizing the data, call the parent class's method super.configure(element) to ensure that the framework automatically loads some default data.

[0047] (2) Create a new Sampler using createTestElement(), and then set the data in the interface to this new Sampler instance.

[0048] (3) Specify a fixed name using getStaticLabel. In this embodiment, the Sampler display name is set to the fixed "RSF Request".

[0049] (4) Define five configuration parameters in RSFSamplerUI, namely service contract, implementation code, method name, message type input field type and message content input field type; among them, the message type input field type is set to JLabeledTextField type and the message content input field type is set to JSyntaxTextArea type.

[0050] 1.3 Develop the data processing module, as detailed below:

[0051] (1) Create getter / setter methods for the parameters in the RSFSamplerUI class for data exchange with the interface. This way, when saving / opening the .jmx script file, this data will be automatically serialized / deserialized.

[0052] (2) Write message conversion code to implement automatic message type conversion. For example, use the JSON.parseObject method to automatically convert String to Map type; use BeanUtil.map2Bean to convert Map type to object type.

[0053] 1.4 Develop the RSF Sampler module as follows: Create the RSFSampler class, inheriting from the parent class org.apache.jmeter.samplers.AbstractSampler, and override the SampleResult sample(Entry arg0) method. This allows Jmeter to initiate requests to the target system, including registering and calling the RSF service contract, calling the RSF interface, displaying sampler request data, and verifying whether the response message meets expectations. If the verification response message meets expectations, call setSuccessful(true) to indicate that the request was successful; if the verification response message does not meet expectations, call setSuccessful(false) to indicate that the request failed, and call setResponseData(output.toString(),"utf-8") to display the error information; when the verification response message is empty or other exceptions occur, also call setSuccessful(false) in the catch method to indicate that the request failed, and call setResponseData(e.toString()) to display the exception information.

[0054] 1.4 Package the above implementation into a JAR file and place it in the corresponding ext folder of Jmeter. This file will be used in the sampler interface for creating new RSFRequests in Jmeter. In the interface, set the corresponding service contract, implementation code, method name, and message content, and perform necessary parameterization settings on the message content. Then, you can start multi-threading in Jmeter to perform performance testing on the RSF interface.

[0055] The above description is merely a preferred embodiment of the present invention. It should be noted that for those skilled in the art, other parts not specifically described are existing technology or common knowledge. Several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A JMeter-based RSF performance testing method, characterized in that, include: Step 1: Develop a JMeter plugin to invoke request messages from the remote service framework RSF; Step 2: In the sampler interface of the JMeter plugin, set the basic data of the Remote Service Framework (RSF) request message; Step 3: Determine whether the request message of the remote service framework RSF is in JsonString format. If not, convert the request message of the remote service framework RSF into JsonString format. Step 4: Input the content of the request message in JsonString format into the request message text box of the JMeter plugin to convert the request message into the set message type; Step 5: Send the transformed request message to the server registered with the Remote Service Framework (RSF); Step 6: Receive the response message returned by the server and verify the received response message. If the response message meets the expectations, mark the request as successful; otherwise, mark the request as failed. Step 7: Use JMeter's built-in performance statistics tool to analyze the number of transactions per second and transaction response time based on the received response messages, and analyze the success rate based on the verification results. Then, display the analyzed content. Step 1 specifically includes: Step 1.1: Create a Maven project and import the necessary dependencies, including ApacheJMeter_core, ApacheJMeter_java, and RSF; Step 1.2: Develop and create an RSFSamplerUI class that inherits from the parent class org.apache.jmeter.samplers.gui.AbstractSamplerGui, and implement the interface design and layout by overriding the parent class; Step 1.3: Develop the data processing module, as detailed below: (1) Create getter / setter methods corresponding to the parameters in the RSFSamplerUI class for data exchange with the interface; (2) Write message conversion code to achieve automatic conversion of message types; Step 1.4: Develop the RSF Sampler module, as follows: Create the RSFSampler class, inheriting from the parent class org.apache.jmeter.samplers.AbstractSampler, and override the SampleResult sample(Entry arg0) method. This allows Jmeter to initiate requests to the target system, including registering and calling the RSF service contract, calling the RSF interface, displaying sampler request data, and verifying whether the response message meets expectations. If the verification response message meets expectations, call setSuccessful(true) to indicate that the request was successful; if the verification response message does not meet expectations, call setSuccessful(false) to indicate that the request failed, and call setResponseData(output.toString(),"utf-8") to display the error information; when the verification response message is empty or other exceptions occur, also call setSuccessful(false) in the catch method to indicate that the request failed, and call setResponseData(e.toString()) to display the exception information. Step 1.5: Package the code and configuration from Steps 1.1 to 1.4 into a JAR file and place it in the corresponding ext folder of JMeter.

2. The RSF performance testing method based on JMeter according to claim 1, characterized in that, The basic data includes service contract, implementation code, method name, and message type.

3. The RSF performance testing method based on JMeter according to claim 2, characterized in that, When a request fails, display the specific error message and serial number in the JMeter window.

4. The RSF performance testing method based on JMeter according to claim 3, characterized in that, The method of implementing interface design and layout by overriding the parent class specifically includes: (1) Load the data from the Sampler into the interface using configure; (2) Create a new Sampler using createTestElement(), and then set the data from the interface into this new Sampler instance; (3) Specify a fixed name using getStaticLabel; (4) Define five configuration parameters in RSFSamplerUI, namely service contract, implementation code, method name, message type input box type and message content input box type.

5. The RSF performance testing method based on JMeter according to claim 4, characterized in that, The input field for the message type is set to JLabeledTextField, and the input field for the message content is set to JSyntaxTextArea.

6. The RSF performance testing method based on JMeter according to claim 1, characterized in that, The message types include JsonObject and Map types.

7. The RSF performance testing method based on JMeter according to claim 1, characterized in that, Use JMeter's assertion feature to pre-set checkpoints and validate received response messages based on the checkpoint content.