Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Jmeter imports DB data and then optimizes

2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

After sharing and prescribing the naming convention, all testers agree that the limitation of jmx files in jmeter is too rigid, which mainly reflects six aspects:

First, it is stipulated that a jmx file can only be entered into one interface, which will lead to a large number of jmx files.

Second: the jmx file imported into DB needs to change the version number in each iteration, which will bring extra work.

Third: the jmx file strictly requires the interface to be executed sequentially, which will cause the written use cases to be re-output.

Fourth: there will be a lot of correspondence between the jmx file of importDB and the jmx file of interface, so one jmx of importDB cannot complete the work of all interfaces.

Fifth: delete the fields that define product type and page type, and add the interface type field

Sixth: test feedback terminal type, version number, interface type do not need to be passed through the jmx file of importDB, but through the http request name to obtain according to certain rules

Therefore, in view of the above four deficiencies, do some optimization.

The changes in technology are mainly reflected in:

First: change the fields such as terminal type, version number, interface type, interface name, number of use cases, number of use cases success, and pass rate. Before, only some of the fields (interface type, interface name) were list structure, but now they are all changed to list structure.

Second: the sql of the java set operation only has the detailed table, while the statistical table is operated through sql (the values of each field insert and update of the statistical table are calculated through the select detailed table)

Third: the federated unique index adds a field creatTime, because the test response can only retain the data of this iteration according to the previous federated index, and the data is retained according to the previous iteration, and the data is now retained according to the current day (so it can be changed from accurate to second to accurate to day)

Fourth: each field acquisition rule of SQL is restricted.

Jmeter thread request naming convention:

Because the code makes the rules of field acquisition, it is considered to be the interface and use case to be checked in this jmx file when looping to the keyword "terminal, version, type, check, interface".

Terminal type acquisition rules:

Because the code makes the rules for obtaining the terminal type, it intercepts the characters between "terminal" and "version" as the terminal type.

Version number acquisition rules:

Because the code makes the rule of obtaining the version number, the character between "terminal" and "version" is intercepted as the version number.

API type acquisition rules:

Because the code makes the rules for obtaining the interface type, it intercepts the characters between "terminal" and "version" as the interface type.

API name acquisition rules:

Because the code makes the rules for obtaining the interface name, the characters between "check" and "interface" are intercepted as the interface name.

Use case name acquisition rules:

Because the code makes the rules for obtaining the use case name, intercept the characters after "interface" as the interface name

The specific SQL key value is selected as follows:

/ / get the terminal type public static ArrayList getTerminalType (String path) throws Exception {CsvUtil util = new CsvUtil (path); int rowNum = util.getRowNum (); String caseAllName = null; String TerminalType = null; ArrayList terminalTypeArray = new ArrayList (); for (int item1uti)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report