Performance test method and device, storage medium and electronic equipment
By creating scheduled test tasks and calling target testing tools in a distributed cloud storage environment, the problem of Cosbench testing tools being unable to perform scheduled tests was solved, realizing automated scheduled testing of script files and improving testing efficiency.
Patent Information
- Application Number
- CN202210557657.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-19
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-05-19
AI Technical Summary
In existing technologies, the Cosbench testing tool cannot perform scheduled testing of script files. It requires manual input of the address and submission of the test file, and therefore cannot achieve automated scheduled testing.
In a distributed cloud storage environment, create cloud hosts for control nodes and running nodes, create scheduled test tasks, write the target time point and file name into the script file, run query commands to confirm task success, call the target test tool at the target time point to perform the test, and export the test results.
It enables automated scheduled testing of script files, reducing manual interaction and improving the automation level and efficiency of testing.
Smart Images

Figure CN114924940B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more specifically, to a performance testing method, apparatus, storage medium, and electronic device. Background Technology
[0002] In the existing technology, the Cosbench testing tool can be used to perform object storage benchmark performance testing on the script file to be tested.
[0003] However, when using the Cosbench testing tool, engineers need to manually enter the web access console address http: / / {controller-ip}:19088 / controller, click submit new workloadsurl, and submit the test file. This means that test scripts can only be tested in real time and cannot be tested on a scheduled basis. Summary of the Invention
[0004] This invention provides a performance testing method, apparatus, storage medium, and electronic device to at least solve the technical problem that script files cannot be tested on a regular basis.
[0005] According to one aspect of the present invention, a performance testing method is provided, comprising: creating a cloud host in a distributed cloud storage environment as a control node and a running node; creating a scheduled test task within the cloud host; writing a target time point and the file name of the script file for performing read / write performance tests on computing nodes in the distributed cloud storage environment into the scheduled test task; running a query command, and determining that the scheduled test task was successfully created if the output result is "startup successful"; calling a target testing tool to test the script file when the current time reaches the target time point; and exporting the test results of the script file after the script file has been tested.
[0006] According to another aspect of the present invention, a performance testing apparatus is provided, comprising: a first creation module for creating a cloud host as a control node and a running node in a distributed cloud storage environment; a second creation module for creating a scheduled test task within the cloud host; a writing module for writing a target time point and the file name of the script file for performing read / write performance tests on computing nodes in the distributed cloud storage environment into the scheduled test task; a determining module for running a query command and determining that the scheduled test task has been successfully created if the output result is "startup successful"; a calling module for calling a target testing tool to test the script file when the current time reaches the target time point; and an export module for exporting the test results of the script file after it has been tested.
[0007] As an optional example, the above-described writing module includes: a creation unit for creating target code in the timed test task; a first acquisition unit for acquiring the date, hour, minute, and second values of the target time point in the script file when there is only one script file; and a filling unit for filling the acquired values into the first position of the target code in sequence and filling the file name of the script file into the second position of the target code.
[0008] As an optional example, the creation module further includes: a first processing unit, configured to, when multiple script files exist, treat each script file as the current script file and perform the following operations on the current script file: fill the value of the target time point of the current script file into the target code at the first position of the code line corresponding to the current script file; fill the file name of the current script file into the target code at the second position of the code line corresponding to the current script file, wherein each current script file corresponds to one or more lines of code in the target code.
[0009] As an optional example, the creation module further includes: a second processing unit, configured to, when multiple script files exist, fill the target time point value of the first script file into the target code at the first position of the code line corresponding to the first script file, and fill the file name of the first script file into the target code at the second position of the code line corresponding to the first script file; take each script file other than the first script file as the current script file, and perform the following operations on the current script file: obtain the first value of the target time point of the previous script file of the current script file; add the test interval duration to the first value to obtain the second value of the target time point of the current script file, fill the second value into the target code at the first position of the code line corresponding to the current script file; and fill the file name of the current script file into the target code at the second position of the code line corresponding to the current script file, wherein the test interval duration is the test time interval between two adjacent script files among the multiple script files.
[0010] As an optional example, the above export module includes: a second acquisition unit, used to acquire the web address of the target testing tool that stores the test results; and a first export unit, used to export all data from the web address to a table file in a table format.
[0011] As an optional example, the above-mentioned export module includes: a third acquisition unit, used to acquire the web address of the target testing tool that stores the test results; and a second export unit, used to export the tabular data in the web address to a table file.
[0012] As an optional example, the second export unit includes: an identification subunit for identifying data in the webpage address; a first determination subunit for determining, if the first keyword is identified, that the first keyword is the starting data of the table-formatted data; a second determination subunit for determining, if the second keyword is identified, that the second keyword is the ending data of the table-formatted data; and an export subunit for exporting the data between the starting data and the ending data to the table file.
[0013] According to another aspect of the present invention, a storage medium is also provided, wherein a computer program is stored in the storage medium, and the computer program is executed by a processor to perform the above-described performance testing method.
[0014] According to another aspect of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to execute the performance testing method described above through the computer program.
[0015] In this embodiment of the invention, a cloud host serving as both a control node and a running node is created in a distributed cloud storage environment. A scheduled test task is created within the cloud host. The scheduled test task includes a target time point and the filename of a script file used to perform read / write performance tests on the computing nodes in the distributed cloud storage environment. A query command is executed, and if the output indicates successful startup, the scheduled test task is confirmed to have been successfully created. When the current time reaches the target time point, a target testing tool is invoked to test the script file. After the script file is tested, the test results are exported. This method, when performing read / write performance tests on computing nodes in a distributed storage environment, allows the creation of a cloud host serving as both a control node and a running node. By creating a scheduled test task within the cloud host, the target time point and filename of the test script file are configured. After configuration, a query command is executed to ensure successful creation of the scheduled test task. Therefore, when the current time reaches the target time point, the target testing tool can be invoked to automatically test the script file without requiring manual interaction between engineers and the testing tool. This achieves the goal of periodically testing the script file and solves the technical problem of the inability to periodically test script files. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0017] Figure 1 This is a flowchart of an optional performance testing method according to an embodiment of the present invention;
[0018] Figure 2 This is a flowchart of another optional performance testing method according to an embodiment of the present invention;
[0019] Figure 3 This is a schematic diagram of the structure of an optional performance testing device according to an embodiment of the present invention;
[0020] Figure 4 This is a schematic diagram of an optional electronic device according to an embodiment of the present invention. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0023] According to a first aspect of the present invention, a performance testing method is provided, optionally, as follows: Figure 1 As shown, the above method includes:
[0024] S102, creating a cloud host in a distributed cloud storage environment as a control node and running node;
[0025] S104, Create a scheduled test task in the cloud host;
[0026] S106, Write the target time point and the file name of the script file used to perform read and write performance tests on the computing nodes in the distributed cloud storage environment into the timed test task;
[0027] S108, run the query command, and if the output result is "startup successful", determine that the scheduled test task has been created successfully;
[0028] S110, if the current time reaches the target time point, call the target testing tool to test the script file;
[0029] S112, After the script file is tested, export the test results of the script file.
[0030] Optionally, in this embodiment, cloud hosts with control nodes and running nodes can be created in a distributed cloud storage environment. When creating cloud hosts, virtual machines of the cloud hosts can be configured on each computing node, or virtual machines of the cloud hosts can be configured on a subset of the computing nodes. There can be one or more script files for the read / write performance test. The filename of the script file for the read / write performance test is obtained; the filename can be a filename string or a unique file identifier. After obtaining the filename, a scheduled test task is created. The scheduled test task can be configured with the target time point and filename for starting the test on the script file.
[0031] After creating a scheduled test task, you can run a query command to check if the task started successfully. You can view the output of the query command; if the output indicates successful startup, you can monitor the target time point of the test script file within the task. Once configured, when the target time point is reached, the system will invoke the target testing tool to test the script file, obtain the test results, and export them.
[0032] In this embodiment, by creating a scheduled test task, a target time point can be set for the test script file, and the script file can be automatically tested at the target time point, thus achieving the effect of scheduled testing of the script file.
[0033] As an optional example, a scheduled test task is created, in which a target time point for a script file used to perform read / write performance tests on the compute nodes in the distributed cloud storage environment is written, and the file name of the script file includes:
[0034] Create the target code in the scheduled test task;
[0035] If there is only one script file, obtain the date, hour, minute, and second values of the script file at the target time point;
[0036] Fill the obtained values into the first position of the target code in order;
[0037] Enter the filename of the script file into the second position of the target code.
[0038] Optionally, in this embodiment, target code can be created when creating a scheduled test task. The target code can be template code, containing a first position and a second position. The first position contains the date, hour, minute, and second values of the target time point, and the second position contains the filename of the script file. The resulting target code is the code that automatically tests the script file at the target time point. Using target code simplifies the process of creating scheduled test tasks and improves creation efficiency.
[0039] In this embodiment, the value of the target time point can be partially omitted. For example, only the values of hours, minutes, and seconds can be obtained, or only the values of minutes and seconds can be obtained, etc.
[0040] As an optional example, the above method also includes:
[0041] If multiple script files exist, treat each script file as the current script file and perform the following operations on the current script file:
[0042] Fill the target time point value of the current script file into the target code, at the first position of the code line corresponding to the current script file;
[0043] Enter the filename of the current script file into the target code, at the second position of the code line corresponding to the current script file. Each current script file corresponds to one or more lines of code in the target code.
[0044] Optionally, in this embodiment, when there are multiple script files to be tested, there are several ways to create the target code. One method is that each script file to be tested serves as the current script file. The number of lines of code in the target code corresponds to the number of script files to be tested. Each current script file corresponds to one line of code. Each line of code includes a first position and a second position. The target time point value of the current script file is filled into the first position of the corresponding line of code, and the filename of the current script file is filled into the second position of the corresponding line of code to obtain the target code. Each current script file can also correspond to multiple lines of code, which can be called a code segment. A code segment contains the aforementioned first and second positions.
[0045] For example, if there are two script files to be tested, and the target time point of the first script file is 2022-01-01 12:00:00, then the value 20220101120000 is extracted and filled into the first position of the corresponding code line according to the format. The file name of the first script file, such as 123.xml, is filled into the second position of the corresponding code line. The information of the second script file to be tested is also filled into the first and second positions of the corresponding code lines.
[0046] As an optional example, the above method also includes:
[0047] If there are multiple script files, fill the target time point value of the first script file into the target code at the first position of the code line corresponding to the first script file, and fill the file name of the first script file into the target code at the second position of the code line corresponding to the first script file.
[0048] Treat each script file except the first one as the current script file, and perform the following operations on the current script file: obtain the first value of the target time point of the previous script file of the current script file; add the test interval duration to the first value to obtain the second value of the target time point of the current script file; fill the second value into the first position of the code line corresponding to the current script file in the target code; fill the file name of the current script file into the second position of the code line corresponding to the current script file in the target code. Here, the test interval duration is the test time interval between two adjacent script files among multiple script files.
[0049] Optionally, in this embodiment, when there are multiple script files to be tested, there are several ways to create the target code. One such way is to fill the first script file's target time point value into the first position of the first line of code in the target code, and fill the first script file's filename into the second position of the first line of code in the target code. Each subsequent script file to be tested is treated as the current script file, and the target time point of each current script file is the target time point of the previous script file plus the test time interval. For example, if the test time interval is 30 seconds, then the target time point of each script file is delayed by 30 seconds compared to the target time point of the previous script file. The target time point value is filled into the first position of the corresponding code line, and the script filename is filled into the second position of the corresponding code line.
[0050] For example, if there are two script files to be tested, with a test interval of 30 seconds, and the target time point of the first script file is 2022-01-01, 12:00:00, then the extracted value is 20220101120000. The target time point of the second script file to be tested is 2022-01-01, 12:00:30, then the extracted value is 20220101120030.
[0051] As an optional example, after creating a scheduled test task, the above method also includes:
[0052] Start the scheduled test task using the first command;
[0053] Use the second command to detect the scheduled test task, where the second command is used to detect whether the scheduled test task started successfully or failed to start.
[0054] Optionally, in this embodiment, after creating a scheduled test task, a first command can be used to start the scheduled test task. After the scheduled test task is started, the test script file can be run at the target time. A second command can be used to check whether the scheduled test task has started successfully. If the start fails, an alarm should be issued.
[0055] As an optional example, after the script file is tested, the test results for exporting the script file include:
[0056] Obtain the web address where the target testing tool stores the test results;
[0057] Export all data from the webpage address to a table file in tabular format.
[0058] Optionally, in this embodiment, after testing the read / write performance of the script file and obtaining the test results, the test results can be automatically exported. Since the test results are located in a web page, all data from the web page can be exported to a table during automatic export. During export, the data must be formatted correctly; data not in the table should be converted to a table format and then entered into the table.
[0059] As an optional example, after the script file is tested, the test results for exporting the script file include:
[0060] Obtain the web address where the target testing tool stores the test results;
[0061] Export the table-formatted data from the webpage address to a table file.
[0062] Optionally, in this embodiment, when exporting data from a web page to a table file, the format of the data in the web page can also be detected. If it is not in a table format, the data is not exported. If it is in a table format, the table-formatted data is exported. After export, it is stored in a table file. The table file does not include non-table formatted data from the web page.
[0063] As an optional example, exporting table-formatted data from a webpage address to a table file includes:
[0064] Identify data in web page URLs;
[0065] Once the first keyword is identified, determine the starting data for the data in tabular format that is the first keyword;
[0066] If a second keyword is identified, determine that the second keyword is the end data of the table-formatted data;
[0067] Export the data between the start and end data to a table file.
[0068] Optionally, in this embodiment, if table-formatted data is to be exported, keywords can also be identified in addition to format recognition during data export. If the first keyword is identified, it is considered that the start position of the table-formatted data has been identified. If the second keyword is identified, it is considered that the end position of the table-formatted data has been identified, and the data between the start and end positions is exported as table-formatted data and written to a table file.
[0069] Figure 2 This is a flowchart of this embodiment. (As shown...) Figure 2 As shown, in this embodiment, a scheduled test task is created. The filename of the script file to be tested is written to the second position of the scheduled test task, and the target time point for testing the script file is written to the first position of the scheduled test task. The scheduled test task is started. If it starts successfully, the script file is tested at the target time point; if it fails to start, it is restarted. After testing the script file, the test results are exported.
[0070] In this embodiment, the target testing tool can be the cosbench testing tool.
[0071] According to the test plan, cloud hosts are created in the environment where testing is required, serving as both the controller node and the virtual machine node. To ensure more accurate test data, the virtual machines are distributed across each compute node during the test. The cosbench testing tool is installed on one of the cloud hosts.
[0072] Once the target testing tool is deployed, you can configure scheduled test cron jobs.
[0073] First, create a cron job and configure the target code:
[0074] crontab-e: 30 10*** / bin / sh / root / test>dev / null 2>&1
[0075] vi test:sleep 300sh cli.sh submit{test.xml}
[0076] Here, 30 10 represents the target time point. test.xml represents the file name.
[0077] To start the crontab service, type the command `systemctl start crond.service`. To ensure the service starts successfully, type `systemctl status crond.service` to check. If it starts successfully, it will output "active (running)," indicating that the service has started and will automatically test the script file at the target time.
[0078] After obtaining the test results, the data is exported. In this embodiment, data export can be automatic. After the test is completed, the test results are automatically exported to a spreadsheet file. Alternatively, when setting the "Export" button, reflection can be used to rebind it, and then the internally generated HTML address can be obtained through the rebound control's ID for Excel export. Create a new user control, configure an "Export" button, and in the "Export" button click event: find the agreed-upon list control, and after finding it, call the agreed-upon method via reflection. After the call, the list control will be filled with content. Read the internal HTML address of the list control and export it.
[0079] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0080] According to another aspect of the embodiments of this application, a performance testing apparatus is also provided, such as... Figure 3 As shown, it includes:
[0081] The first creation module 302 is used to create cloud hosts as control nodes and running nodes in a distributed cloud storage environment;
[0082] The second creation module 304 is used to create a scheduled test task within the cloud host.
[0083] The writing module 306 is used to write the target time point and the file name of the script file for performing read and write performance tests on the computing nodes in the distributed cloud storage environment into the timed test task.
[0084] The module 308 is used to run the query command. If the output result is "startup successful", it is determined that the timed test task has been created successfully.
[0085] Module 310 is used to invoke the target testing tool to test the script file when the current time reaches the target time point;
[0086] The export module 312 is used to export the test results of the script file after the script file is tested.
[0087] Optionally, in this embodiment, cloud hosts with control nodes and running nodes can be created in a distributed cloud storage environment. When creating cloud hosts, virtual machines of the cloud hosts can be configured on each computing node, or virtual machines of the cloud hosts can be configured on a subset of the computing nodes. There can be one or more script files for the read / write performance test. The filename of the script file for the read / write performance test is obtained; the filename can be a filename string or a unique file identifier. After obtaining the filename, a scheduled test task is created. The scheduled test task can be configured with the target time point and filename for starting the test on the script file.
[0088] After creating a scheduled test task, you can run a query command to check if the task started successfully. You can view the output of the query command; if the output indicates successful startup, you can monitor the target time point of the test script file within the task. Once configured, when the target time point is reached, the system will invoke the target testing tool to test the script file, obtain the test results, and export them.
[0089] In this embodiment, by creating a scheduled test task, a target time point can be set for the test script file, and the script file can be automatically tested at the target time point, thus achieving the effect of scheduled testing of the script file.
[0090] As an optional example, the above-mentioned creation module includes:
[0091] A creation unit is used to create target code in the timed test task;
[0092] The first acquisition unit is used to acquire the date, hour, minute and second values of the target time point in the script file when there is only one script file;
[0093] The fill cell is used to fill the obtained values into the first position of the target code in order, and to fill the file name of the script file into the second position of the target code.
[0094] Optionally, in this embodiment, target code can be created when creating a scheduled test task. The target code can be template code, containing a first position and a second position. The first position contains the date, hour, minute, and second values of the target time point, and the second position contains the filename of the script file. The resulting target code is the code that automatically tests the script file at the target time point. Using target code simplifies the process of creating scheduled test tasks and improves creation efficiency.
[0095] In this embodiment, the value of the target time point can be partially omitted. For example, only the values of hours, minutes, and seconds can be obtained, or only the values of minutes and seconds can be obtained, etc.
[0096] As an optional example, the above-mentioned creation module also includes:
[0097] The first processing unit is used to, when there are multiple script files, treat each script file as the current script file and perform the following operations on the current script file: fill the value of the target time point of the current script file into the first position of the code line corresponding to the current script file in the target code; fill the file name of the current script file into the second position of the code line corresponding to the current script file in the target code, wherein each current script file corresponds to one or more lines of code in the target code.
[0098] Optionally, in this embodiment, when there are multiple script files to be tested, there are several ways to create the target code. One method is that each script file to be tested serves as the current script file. The number of lines of code in the target code corresponds to the number of script files to be tested. Each current script file corresponds to one line of code. Each line of code includes a first position and a second position. The target time point value of the current script file is filled into the first position of the corresponding line of code, and the filename of the current script file is filled into the second position of the corresponding line of code to obtain the target code. Each current script file can also correspond to multiple lines of code, which can be called a code segment. A code segment contains the aforementioned first and second positions.
[0099] As an optional example, the above-mentioned creation module also includes:
[0100] The second processing unit, when multiple script files exist, is used to: fill the target time point value of the first script file into the target code at the first position of the code line corresponding to the first script file; fill the file name of the first script file into the target code at the second position of the code line corresponding to the first script file; and treat each script file other than the first script file as the current script file, performing the following operations on the current script file: obtain the first value of the target time point of the previous script file; add the test interval duration to the first value to obtain the second value of the target time point of the current script file; fill the second value into the target code at the first position of the code line corresponding to the current script file; and fill the file name of the current script file into the target code at the second position of the code line corresponding to the current script file. The test interval duration is the test time interval between two adjacent script files among the multiple script files.
[0101] Optionally, in this embodiment, when there are multiple script files to be tested, there are several ways to create the target code. One such way is to fill the first script file's target time point value into the first position of the first line of code in the target code, and fill the first script file's filename into the second position of the first line of code in the target code. Each subsequent script file to be tested is treated as the current script file, and the target time point of each current script file is the target time point of the previous script file plus the test time interval. For example, if the test time interval is 30 seconds, then the target time point of each script file is delayed by 30 seconds compared to the target time point of the previous script file. The target time point value is filled into the first position of the corresponding code line, and the script filename is filled into the second position of the corresponding code line.
[0102] As an optional example, the above-mentioned creation module also includes:
[0103] The startup unit is used to start the scheduled test task using the first command after the scheduled test task is created;
[0104] The detection unit is used to detect the timed test task using a second command, wherein the second command is used to detect whether the timed test task started successfully or failed to start.
[0105] Optionally, in this embodiment, after creating a scheduled test task, a first command can be used to start the scheduled test task. After the scheduled test task is started, the test script file can be run at the target time. A second command can be used to check whether the scheduled test task has started successfully. If the start fails, an alarm should be issued.
[0106] As an optional example, the exported modules mentioned above include:
[0107] The second acquisition unit is used to acquire the web address where the target testing tool stores the test results;
[0108] The first export unit is used to export all data from the webpage address to a table file in a tabular format.
[0109] Optionally, in this embodiment, after testing the read / write performance of the script file and obtaining the test results, the test results can be automatically exported. Since the test results are located in a web page, all data from the web page can be exported to a table during automatic export. During export, the data must be formatted correctly; data not in the table should be converted to a table format and then entered into the table.
[0110] As an optional example, the exported modules mentioned above include:
[0111] The third acquisition unit is used to acquire the web address where the target testing tool stores the test results;
[0112] The second export unit is used to export table-formatted data from the webpage address to a table file.
[0113] Optionally, in this embodiment, when exporting data from a web page to a table file, the format of the data in the web page can also be detected. If it is not in a table format, the data is not exported. If it is in a table format, the table-formatted data is exported. After export, it is stored in a table file. The table file does not include non-table formatted data from the web page.
[0114] As an optional example, the second derived unit described above includes:
[0115] The identification subunit is used to identify data in a webpage address;
[0116] The first determining subunit is used to determine the starting data of the first keyword as tabular data when the first keyword is identified;
[0117] The second determining subunit is used to determine the end data of the table-formatted data when the second keyword is identified;
[0118] The Export Subcell is used to export the data between the start and end data to a table file.
[0119] Optionally, in this embodiment, if table-formatted data is to be exported, keywords can also be identified in addition to format recognition during data export. If the first keyword is identified, it is considered that the start position of the table-formatted data has been identified. If the second keyword is identified, it is considered that the end position of the table-formatted data has been identified, and the data between the start and end positions is exported as table-formatted data and written to a table file.
[0120] For other examples of this embodiment, please refer to the examples above, which will not be repeated here.
[0121] Figure 4 This is a structural block diagram of an optional electronic device according to an embodiment of this application, such as... Figure 4 As shown, it includes a processor 402, a communication interface 404, a memory 406, and a communication bus 408. The processor 402, communication interface 404, and memory 406 communicate with each other via the communication bus 408.
[0122] Memory 406 is used to store computer programs;
[0123] When processor 402 executes a computer program stored in memory 406, it performs the following steps:
[0124] Create cloud hosts in a distributed cloud storage environment to serve as control and running nodes;
[0125] Create a scheduled test task within the cloud host;
[0126] The target time point and the file name of the script file used to perform read and write performance tests on the computing nodes in the distributed cloud storage environment are written into the scheduled test task.
[0127] If the query command is executed and the output shows that the startup was successful, then the scheduled test task has been successfully created.
[0128] If the current time reaches the target time point, the target testing tool will be invoked to test the script file;
[0129] After the script file is tested, the test results of the script file are exported.
[0130] Optionally, in this embodiment, the communication bus can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single thick line, but this does not indicate that there is only one bus or one type of bus. The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0131] The memory may include RAM, or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0132] As an example, the memory 406 described above may include, but is not limited to, the first creation module 302, the second creation module 304, the writing module 306, the determining module 308, the calling module 310, and the exporting module 312 from the performance testing device described above. Furthermore, it may include, but is not limited to, other module units from the request processing device described above, which will not be elaborated upon in this example.
[0133] The processors mentioned above can be general-purpose processors, including but not limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; they can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0134] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.
[0135] Those skilled in the art will understand that Figure 4The structure shown is for illustrative purposes only. The device used to implement the above performance testing method can be a terminal device, such as a smartphone (e.g., Android phone, iOS phone), tablet computer, PDA, mobile Internet Device (MID), PAD, etc. Figure 4 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 4 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 4 The different configurations shown.
[0136] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, ROM, RAM, disk or optical disk, etc.
[0137] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is executed by a processor to perform the steps in the above-described performance testing method.
[0138] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0139] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0140] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention.
[0141] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0142] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0143] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0144] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0145] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, 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 performance testing method, characterized in that, include: Create cloud hosts in a distributed cloud storage environment to serve as control and running nodes; Create a scheduled test task within the cloud host; The target time point and the file name of the script file used to perform read and write performance tests on the computing nodes in the distributed cloud storage environment are written into the scheduled test task. If the query command is executed and the output shows that the startup was successful, then the scheduled test task has been successfully created. If the current time reaches the target time point, the target testing tool will be invoked to test the script file; After the script file is tested, the test results of the script file are exported. The step of exporting the test results of the script file after the script file is tested includes: obtaining the web address of the target testing tool where the test results are stored; exporting all data in the web address to a table file in a table format or exporting the table format data in the web address to a table file.
2. The method according to claim 1, characterized in that, The target time point and the file name of the script file used to perform read and write performance tests on the computing nodes in the distributed cloud storage environment, which are written into the scheduled test task, include: Create the target code in the scheduled test task; If there is only one script file, obtain the date, hour, minute, and second values of the target time point in the script file; Fill the obtained values into the first position of the target code in order; Enter the filename of the script file into the second position of the target code.
3. The method according to claim 2, characterized in that, The method further includes: If there are multiple script files, each script file is taken as the current script file, and the following operations are performed on the current script file: The value of the target time point in the current script file is filled into the target code at the first position of the code line corresponding to the current script file; The file name of the current script file is filled into the target code at the second position of the code line corresponding to the current script file, wherein each current script file corresponds to one or more lines of code in the target code.
4. The method according to claim 2, characterized in that, The method further includes: When there are multiple script files, the value of the target time point of the first script file is filled into the target code at the first position of the code line corresponding to the first script file, and the file name of the first script file is filled into the target code at the second position of the code line corresponding to the first script file. Each script file other than the first script file is taken as the current script file, and the following operations are performed on the current script file: obtain the first value of the target time point of the previous script file of the current script file; add the test interval duration to the first value to obtain the second value of the target time point of the current script file; fill the second value into the target code at the first position of the code line corresponding to the current script file; fill the file name of the current script file into the target code at the second position of the code line corresponding to the current script file, wherein the test interval duration is the test time interval between two adjacent script files among the multiple script files.
5. The method according to claim 1, characterized in that, The step of exporting the table-formatted data from the webpage address to a table file includes: Identify the data in the webpage address; If the first keyword is identified, determine that the first keyword is the starting data of the table-formatted data; If a second keyword is identified, the second keyword is determined to be the end data of the data in the table format; Export the data between the starting data and the ending data to the table file.
6. A performance testing device, characterized in that, include: The first creation module is used to create cloud hosts in a distributed cloud storage environment, which serve as control nodes and running nodes. The second creation module is used to create scheduled test tasks within the cloud host. The writing module is used to write the target time point and the file name of the script file for performing read and write performance tests on the computing nodes in the distributed cloud storage environment into the scheduled test task. The determination module is used to run the query command, and if the output result is "startup successful", it is determined that the scheduled test task has been created successfully. The calling module is used to call the target testing tool to test the script file when the current time reaches the target time point; The export module is used to export the test results of the script file after the script file has been tested. The step of exporting the test results of the script file after the script file is tested includes: obtaining the web address of the target testing tool where the test results are stored; exporting all data in the web address to a table file in a table format or exporting the table format data in the web address to a table file.
7. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to perform the method described in any one of claims 1 to 5.
8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 5 through the computer program.
Citation Information
Patent Citations
Performance test method and device, equipment and storage medium
CN113360389A