CN114924940A - Performance test method, device, storage medium and electronic equipment - Google Patents

Performance test method, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114924940A
CN114924940A CN202210557657.2A CN202210557657A CN114924940A CN 114924940 A CN114924940 A CN 114924940A CN 202210557657 A CN202210557657 A CN 202210557657A CN 114924940 A CN114924940 A CN 114924940A
Authority
CN
China
Prior art keywords
script file
file
test
time point
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210557657.2A
Other languages
Chinese (zh)
Inventor
董小瑞
宋立辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202210557657.2A priority Critical patent/CN114924940A/en
Publication of CN114924940A publication Critical patent/CN114924940A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3414Workload generation, e.g. scripts, playback
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3419Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a performance testing method, a performance testing device, a storage medium and electronic equipment. The method comprises the following steps: creating a cloud host as a control node and an operation node in a distributed cloud storage environment; establishing a timing test task in the cloud host; writing a target time point of a script file and a file name of the script file, wherein the target time point is used for executing a read-write performance test on a computing node in a distributed cloud storage environment, in the timing test task; running the query instruction, and determining that the establishment of the timing test task is successful under the condition that the output result is successful in starting; under the condition that the current time reaches a target time point, calling a target test tool test script file; after the script file is tested, the test result of the script file is exported. The invention solves the technical problem that the script file cannot be tested at regular time.

Description

Performance test method, device, storage medium and electronic equipment
Technical Field
The invention relates to the field of computers, in particular to a performance testing method, a performance testing device, a storage medium and electronic equipment.
Background
In the prior art, a Cosbench test tool may be used to perform a test during an object storage benchmark performance test on a script file to be tested.
However, when testing, the Cosbench test tool needs an engineer to manually input the address http:// { controller-ip }:19088/controller, and click submit new workloadSurl to submit the test file, so that when testing the script file, the test can only be performed in real time, and the test cannot be performed regularly.
Disclosure of Invention
The embodiment of the invention provides a performance testing method, a performance testing device, a storage medium and electronic equipment, which at least solve the technical problem that a script file cannot be tested at regular time.
According to an aspect of an embodiment of the present invention, there is provided a performance testing method, including: creating cloud hosts as control nodes and operation nodes in a distributed cloud storage environment; creating a timing test task in the cloud host; writing a target time point of a script file and a file name of the script file in the timing test task, wherein the target time point is used for executing a read-write performance test on a computing node in the distributed cloud storage environment; running a query instruction, and determining that the timing test task is successfully established under the condition that an output result is successful in starting; under the condition that the current time reaches the target time point, calling a target test tool to test the script file; and after the script file is tested, exporting a test result of the script file.
According to another aspect of the embodiments of the present invention, there is provided a performance testing apparatus, including: the system comprises a first establishing module, a second establishing module and a third establishing module, wherein the first establishing module is used for establishing a cloud host which is used as a control node and an operation node in a distributed cloud storage environment; the second establishing module is used for establishing a timing test task in the cloud host; the writing module is used for writing a target time point of a script file and a file name of the script file, wherein the target time point is used for executing a read-write performance test on a computing node in the distributed cloud storage environment, in the timing test task; the determining module is used for running the query instruction and determining that the timing test task is successfully established under the condition that the output result is successful in starting; the calling module is used for calling a target testing tool to test the script file under the condition that the current time reaches the target time point; and the exporting module is used for exporting the test result of the script file after the script file is tested.
As an optional example, the writing module includes: a creating unit, configured to create target codes in the timing test task; a first acquiring unit configured to acquire numerical values of date, hour, minute, and second of the target time point of the script file in a case where there is one script file; and the filling unit is used for filling the acquired numerical values into the first position of the object code according to the sequence and filling the file name of the script file into the second position of the object code.
As an optional example, the creating module further includes: a first processing unit, configured to, when there are multiple script files, take each of the script files as a current script file, and execute the following operations on the current script file: filling the value of the target time point of the current script file into the target code, and the first position of the code line corresponding to the current script file; and filling the file name of the current script file into the second position of the code line corresponding to the current script file, wherein each current script file corresponds to one or more code lines in the object code.
As an optional example, the creating module further includes: a second processing unit configured to, when there are a plurality of script files, fill the target code with the numeric value of the target time point of a first script file, fill the first position of a code line corresponding to the first script file, fill the target code with the file name of the first script file, and fill the second position of a code line corresponding to the first script file; taking each script file except the first script file as a current script file, and executing the following operations on the current script file: acquiring a first numerical value of the target time point of a previous script file of the current script file; adding a test interval duration to the first numerical value to obtain a second numerical value of the target time point of the current script file, and filling the second numerical value into the target code, wherein the first numerical value corresponds to the first position of the code line of the current script file; and filling the file name of the current script file into the target code, wherein the test interval duration is the test interval of two adjacent script files in the plurality of script files.
As an optional example, the derivation module includes: a second obtaining unit, configured to obtain a web address of the target testing tool, where the web address stores the testing result; and the first exporting unit is used for exporting all data in the webpage address to a table file according to a table format.
As an optional example, the derivation module includes: a third obtaining unit, configured to obtain a web address of the target testing tool, where the web address stores the testing result; and the second exporting unit is used for exporting the data in the table format in the webpage address to the table file.
As an alternative example, the second deriving unit includes: an identification subunit, configured to identify data in the web page address; the first determining subunit is used for determining the first keyword as the initial data of the data in the table format under the condition that the first keyword is identified; a second determining subunit, configured to determine, when a second keyword is identified, that the second keyword is end data of the data in the table format; and an export subunit, configured to export the data between the start data and the end data into the table file.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is executed by a processor to perform the performance testing method.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the performance testing method through the computer program.
In the embodiment of the invention, the cloud hosts serving as control nodes and operation nodes are established in a distributed cloud storage environment; creating a timing test task in the cloud host; writing a target time point of a script file and a file name of the script file, which are used for executing read-write performance tests on the computing nodes in the distributed cloud storage environment, in the timing test task; running a query instruction, and determining that the timing test task is successfully established under the condition that an output result is successful in starting; under the condition that the current time reaches the target time point, calling a target testing tool to test the script file; according to the method, when the read-write performance of a computing node in a distributed storage environment is tested, a cloud host of a main control node and an operation node can be created in the environment, a timing test task is created in the cloud host to configure a target time point of a test script file and a file name of the script file, and after configuration, a query instruction is run to ensure that the timing test task is successfully created, so that when the current time reaches the target time point, a target test tool can be called to automatically test the script file, an engineer does not need to manually interact with the test tool, the aim of testing the script file at regular time is achieved, and the technical problem that the script file cannot be tested at regular time is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention and do not constitute a limitation of the invention. In the drawings:
FIG. 1 is a flow chart of an alternative performance testing method according to an embodiment of the present invention;
FIG. 2 is a flow diagram of another alternative performance testing method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an alternative performance testing apparatus according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to a first aspect of the embodiments of the present invention, there is provided a performance testing method, optionally, as shown in fig. 1, the method includes:
s102, creating a cloud host serving as a control node and an operation node in a distributed cloud storage environment;
s104, establishing a timing test task in the cloud host;
s106, writing a target time point of a script file for executing a read-write performance test on a computing node in the distributed cloud storage environment and a file name of the script file in the timing test task;
s108, running the query instruction, and determining that the timing test task is successfully established under the condition that the output result is successful in starting;
s110, calling a target test tool to test the script file under the condition that the current time reaches the target time point;
and S112, after the script file is tested, exporting a test result of the script file.
Optionally, in this embodiment, cloud hosts for controlling nodes and operating nodes may be created in a distributed cloud storage environment, and virtual machines of the cloud hosts may be configured on each computing node when creating the cloud hosts, or virtual machines of the cloud hosts may be configured on a part of computing nodes in all computing nodes. There may be one or more script files to be used for performing the read/write performance test. And acquiring the file name of the script file for executing the read-write performance test, wherein the file name can be a file name character string of the file or a unique file identifier. And after the file name is acquired, a timing test task is created, and a target time point and the file name of the starting test script file can be configured in the timing test task.
After the timing test task is created, a query instruction can be run, and whether the timing test task is started successfully or not can be queried through the query instruction. And the output result output after the query instruction is operated can be checked, and if the output result shows that the timing test task is successfully started, the target time point of the test script file in the timing test task can be monitored. After configuration is completed, when the current time reaches the target time point, the system calls a target test tool test script file to obtain a test result. And derive the test results.
In this embodiment, by creating the timing test task, the target time point of the test script file can be set, and the script file is automatically tested at the target time point, so that the effect of timing the test script file is achieved.
As an alternative example, creating a timing test task, where writing a target time point of a script file and a file name of the script file for performing a read-write performance test on a computing node in the distributed cloud storage environment in the timing test task includes:
creating target code in the timing test task;
under the condition that the script file is one, acquiring the numerical values of the date, the time, the minute and the second of the script file at the target time point;
filling the acquired numerical values into a first position of the target code in sequence;
and filling the file name of the script file into the second position of the object code.
Optionally, in this embodiment, when the timing test task is created, the target code may be created. The object code may be a template code, and the object code includes a first location and a second location, the first location is filled with the date, hour, minute and second values of the target time point, and the second location is filled with the file name of the script file. The resulting object code is the code that automatically tests the script file at the target point in time. Through the target code, the process of creating the timing test task can be simplified, and the creation efficiency is improved.
In this embodiment, the numerical value of the target time point may be partially omitted. For example, only the time-minute-second value, only the minute-second value, or the like may be acquired.
As an optional example, the method further includes:
when a plurality of script files exist, taking each script file as a current script file, and executing the following operations on the current script file:
filling the numerical value of the target time point of the current script file into a target code, wherein the numerical value is at a first position of a code line corresponding to the current script file;
and filling the file name of the current script file into the object code, wherein the file name of the current script file corresponds to the second position of the code line corresponding to the current script file, and each current script file corresponds to one or more code lines in the object code.
Optionally, in this embodiment, when there are a plurality of script files to be tested, there may be a plurality of ways when creating the object code, as one of the ways, each script file to be tested is used as a current script file, and there are several script files to be tested, so there are several lines of code lines in the object code. Each current script file corresponds to a line of code. Each line of code line comprises a first position and a second position, the numerical value of the target time point of the current script file is filled in the first position of the corresponding code line, and the file name of the current script file is filled in the second position of the corresponding code line, so that the target code is obtained. Each current script may also correspond to multiple lines of code lines, which may be referred to as a code segment. A code segment comprises the first location and the second location.
For example, if there are two script files to be tested, and the target time point of the first script file to be tested is 2022-01-01 and 12:00:00, the value 20220101120000 is extracted, the first position of the corresponding code line is filled in according to the format, and the file name of the first script file, such as 123.xml, is filled in the second position of the corresponding code line. The information of the second script file to be tested is also filled in the first position and the second position of the corresponding code line.
As an optional example, the method further includes:
under the condition that a plurality of script files exist, filling the numerical value of the target time point of a first script file into a target code, filling the file name of the first script file into the target code at the first position of a code line corresponding to the first script file, and filling the file name of the first script file into the second position of the code line corresponding to the first script file;
taking each script file except the first script file as a current script file, and executing the following operations on the current script file: acquiring a first numerical value of a target time point of a previous script file of a current script file; adding the test interval duration to the first numerical value to obtain a second numerical value of the target time point of the current script file, and filling the second numerical value into a target code, wherein the first numerical value corresponds to the first position of a code line of the current script file; and filling the file name of the current script file into the target code, wherein the test interval duration is the test time interval of two adjacent script files in the plurality of script files.
Optionally, in this embodiment, when there are a plurality of script files to be tested, there may be a plurality of ways when creating the object code, as one of the ways, a first script file to be tested fills a value of a target time point of the first script file into a first position of a first line code line of the object code, and fills a file name of the first script file into a second position of the first line code line of the object code. And each script file to be tested after the first script file is taken as a 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, the target time point of each script file is delayed by 30 seconds compared to the target time point of the previous script file. And filling the numerical value of the target time point into the first position of the corresponding code line, and filling the file name of the script file into the second position of the corresponding code line.
For example, if there are two script files to be tested, the test time interval is 30 seconds, the target time point of the first script file to be tested is 2022-01-01 and 12:00:00, the value is extracted as 20220101120000, and the target time point of the second script file to be tested is 2022-01-01 and 12:00:30, the value is extracted as 20220101120030.
As an optional example, after the timing test task is created, the method further includes:
starting a timing test task by using a first command;
and detecting the timing test task by using a second command, wherein the second command is used for detecting the success or failure of the starting of the timing test task.
Optionally, in this embodiment, after the timing test task is created, the timing test task may be started by using the first command. After the timing test task is started, the timing test task can be operated at a target time point to start testing the script file. A second command may be used to detect whether the timed test task started successfully. And if the starting fails, alarming is carried out.
As an alternative example, after the script file is tested, exporting the test result of the script file includes:
acquiring a webpage address storing a test result of a target test tool;
and exporting all data in the webpage address to a table file according to a table format.
Optionally, in this embodiment, after the read-write performance of the script file is tested, after a test result is obtained, the test result may be automatically derived. Since the test results are located in one web page. Thus, when test results are automatically exported, all data in the web page may be exported into the table. When exporting, exporting according to the format, converting the data in the non-form into the form format, and filling the form.
As an alternative example, after the script file is tested, exporting the test result of the script file comprises:
acquiring a webpage address of a target test tool for storing a test result;
and exporting the data in the table format in the webpage address to a table file.
Optionally, in this embodiment, when exporting the data in the web page to the table file, the format of the data in the web page may also be detected, and if the data is in the non-table format, the data is not exported. If the data is in the table format, the data in the table format is exported. After being exported, the data is stored in a form file. Data in a non-tabular format in the web page is not included in the tabular file.
As an alternative example, exporting data in tabular format in a web page address to a tabular file includes:
identifying data in the web page address;
under the condition that the first keyword is identified, determining the first keyword as initial data of data in a table format;
under the condition that the second keyword is identified and obtained, determining that the second keyword is ending data of data in a table format;
exporting data between the start data and the end data to a table file.
Optionally, in this embodiment, if data in a table format is to be derived, when deriving data, in addition to identifying a format, a keyword may also be identified. If the first keyword is identified, it is considered that the start position of the data in the table format is identified. And if the second keyword is identified, considering that the ending position of the data in the table format is identified, exporting the data between the starting position and the ending position as the data in the table format, and writing the data in the table file.
Fig. 2 is a flowchart of the present embodiment. As shown in fig. 2, in this embodiment, a timing test task is created, a file name of a script file to be tested is written into a second position of the timing test task, and a target time point of testing the script file to be tested is written into a first position of the timing test task. And starting a timing test task, if the timing test task is started successfully, testing the script file at a target time point, and if the timing test task is started unsuccessfully, restarting the timing test task. And exporting a test result after testing the script file.
In this embodiment, the target test tool may use a cosbench test tool.
And creating a cloud host used as a control controller node and a running river node according to the test scheme in an environment needing to be tested, and distributing virtual machines to each computing node in the test process for more accurate test data. And installing a cosbench testing tool on one cloud host.
After the target test tool is deployed, a timing test cron task can be configured.
Creating a cron task, configuring object codes:
crontab-e:30 10***/bin/sh/root/test>dev/null 2>&1
vi test:sleep 300sh cli.sh submit{test.xml}
where 3010 represents the target time point. Xml denotes the file name.
Starting the crontab service: a command system start connected service is entered, where in order to ensure that the service starts successfully, the system start connected service is entered to check whether it starts successfully. If the starting is successful, an active (running) word is output, which indicates that the service is started, and the script file is automatically tested when the target time point is reached.
After the test results are obtained, data is derived. In this embodiment, data may be automatically derived. And after the test is finished, automatically exporting the test result to a form file. When the 'export' button can be set, rebinding can be carried out through reflection, then the html address generated inside is obtained through the control mark ID after rebinding, Excel export can be carried out, a 'export' button is configured for a new user control, and in the 'export' button click event: finding out the appointed list control, finding out a method for calling the appointment by post reflection, and filling the list control with the content after calling. And reading the internal html address of the list control and exporting.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art will appreciate that the embodiments described in this specification are presently preferred and that no acts or modules are required by the invention.
According to another aspect of the embodiments of the present application, there is also provided a performance testing apparatus, as shown in fig. 3, including:
a first creating module 302, configured to create a cloud host as a control node and an operation node in a distributed cloud storage environment;
a second creating module 304, configured to create a timing test task in the cloud host;
a writing module 306, configured to write a target time point of a script file and a file name of the script file, where the target time point is used to execute a read/write performance test on a computing node in the distributed cloud storage environment, in the timing test task;
the determining module 308 is configured to run the query instruction, and determine that the timed test task is successfully created when the output result is that the start is successful;
a calling module 310, configured to call a target testing tool to test the script file when the current time reaches the target time point;
an export module 312, configured to export the test result of the script file after the script file is tested.
Optionally, in this embodiment, a cloud host that controls nodes and runs nodes may be created in a distributed cloud storage environment, and when creating the cloud host, a virtual machine of the cloud host may be configured on each computing node, or a virtual machine of the cloud host may be configured on a part of computing nodes in all the computing nodes. There may be one or more script files to be subjected to the read/write performance test. And acquiring the file name of the script file for executing the read-write performance test, wherein the file name can be a file name character string of the file or a unique file identifier. And after the file name is obtained, a timing test task is created, and a target time point and the file name of the starting test script file can be configured in the timing test task.
After the timing test task is created, a query instruction can be run, and whether the timing test task is started successfully or not can be queried through the query instruction. And the output result output after the query instruction is operated can be checked, and if the output result shows that the timing test task is successfully started, the target time point of the test script file in the timing test task can be monitored. After configuration is completed, when the current time reaches the target time point, the system calls a target test tool test script file to obtain a test result. And derive the test results.
In the embodiment, by creating the timing test task, the target time point of the test script file can be set, and the script file is automatically tested at the target time point, so that the effect of timing the test script file is realized.
As an optional example, the creating module includes:
a creating unit, configured to create target codes in the timing test task;
a first acquiring unit, configured to acquire numerical values of date, hour, minute, and second of the target time point of a script file if there is one script file;
and the filling unit is used for filling the acquired numerical values into the first position of the object code in sequence and filling the file name of the script file into the second position of the object code.
Optionally, in this embodiment, when the timing test task is created, the target code may be created. The object code may be a template code, and the object code includes a first location and a second location, the first location is filled with the date, hour, minute and second values of the target time point, and the second location is filled with the file name of the script file. The resulting object code is the code that automatically tests the script file at the target point in time. Through the target code, the process of creating the timing test task can be simplified, and the creating efficiency is improved.
In this embodiment, the numerical value of the target time point may be partially omitted. For example, only the time-minute-second value, only the minute-second value, or the like may be acquired.
As an optional example, the creating module further includes:
a first processing unit, configured to, in a case where there are a plurality of script files, regard each script file as a current script file, and perform the following operations on the current script file: filling the numerical value of the target time point of the current script file into a target code, wherein the numerical value is at a first position of a code line corresponding to the current script file; and filling the file name of the current script file into the object code, wherein each current script file corresponds to one or more lines of code lines in the object code.
Optionally, in this embodiment, when there are multiple script files to be tested, there may be multiple ways when creating the object code, and as one of the ways, if there are several script files to be tested as the current script file, there are several lines of code lines in the object code. Each current script file corresponds to a line of code. Each line of code line comprises a first position and a second position, the numerical value of the target time point of the current script file is filled in the first position of the corresponding code line, and the file name of the current script file is filled in the second position of the corresponding code line, so that the target code is obtained. Each current script may also correspond to multiple lines of code lines, which may be referred to as a code segment. A code segment comprises the first location and the second location.
As an optional example, the creating module further includes:
the second processing unit is used for filling the numerical value of the target time point of the first script file into the target code under the condition that a plurality of script files exist, filling the file name of the first script file into the target code and filling the second position of the code line corresponding to the first script file, wherein the first position of the code line corresponds to the first script file; taking each script file except the first script file as a current script file, and executing the following operations on the current script file: acquiring a first numerical value of a target time point of a previous script file of a current script file; adding the test interval duration to the first numerical value to obtain a second numerical value of the target time point of the current script file, and filling the second numerical value into the target code, wherein the first numerical value corresponds to the first position of the code line of the current script file; and filling the file name of the current script file into the target code, wherein the test interval duration is the test time interval of two adjacent script files in the plurality of script files.
Optionally, in this embodiment, when there are a plurality of script files to be tested, there may be a plurality of ways when creating the object code, where as one way of the ways, the first script file to be tested fills the value of the target time point of the first script file into the first position of the first line code line of the object code, and fills the file name of the first script file into the second position of the first line code line of the object code. And each script file to be tested after the first script file is taken as a 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, the target time point of each script file is delayed by 30 seconds compared to the target time point of the previous script file. And filling the numerical value of the target time point into the first position of the corresponding code line, and filling the file name of the script file into the second position of the corresponding code line.
As an optional example, the creating module further includes:
the starting unit is used for starting the timing test task by using a first command after the timing test task is established;
and the detection unit is used for detecting the timing test task by using a second command, wherein the second command is used for detecting the success or failure of the starting of the timing test task.
Optionally, in this embodiment, after the timing test task is created, the timing test task may be started by using the first command. After the timing test task is started, the timing test task can be run at a target time point to start testing the script file. A second command may be used to detect whether the timed test task started successfully. And if the starting fails, alarming is carried out.
As an optional example, the derivation module includes:
the second acquisition unit is used for acquiring a webpage address of the target test tool for storing the test result;
and the first exporting unit is used for exporting all data in the webpage address to a table file according to a table format.
Optionally, in this embodiment, after the read-write performance of the script file is tested, after a test result is obtained, the test result may be automatically derived. Since the test results are located in one web page. Thus, when test results are automatically exported, all data in the web page may be exported into a table. When exporting, exporting according to the format, converting the data in the non-form into the form format, and filling the form.
As an optional example, the derivation module includes:
the third acquisition unit is used for acquiring a webpage address of the target test tool for storing the test result;
and the second exporting unit is used for exporting the data in the table format in the webpage address to the table file.
Optionally, in this embodiment, when exporting the data in the web page to the table file, the format of the data in the web page may also be detected, and if the data is in a non-table format, the data is not exported. If the data is in the table format, the data in the table format is exported. After being exported, the information is stored in a table file. Data in the non-tabular format in the web page is not included in the tabular file.
As an alternative example, the second deriving unit includes:
the identification subunit is used for identifying data in the webpage address;
the first determining subunit is used for determining the first keyword as the initial data of the data in the table format under the condition that the first keyword is identified;
the second determining subunit is used for determining the second keyword as ending data of the data in the table format under the condition that the second keyword is identified;
and the exporting subunit is used for exporting the data between the starting data and the ending data into the table file.
Optionally, in this embodiment, if data in a table format is to be derived, when deriving data, in addition to identifying a format, a keyword may also be identified. If the first key is identified, the start position of the data in the table format is considered to be identified. And if the second keyword is identified, considering that the ending position of the data in the table format is identified, exporting the data between the starting position and the ending position as the data in the table format, and writing the data in the table file.
For other examples of this embodiment, please refer to the above examples, which are not described herein.
Fig. 4 is a block diagram of an alternative electronic device according to an embodiment of the present application, as shown in fig. 4, including a processor 402, a communication interface 404, a memory 406, and a communication bus 408, where the processor 402, the communication interface 404, and the memory 406 communicate with each other through the communication bus 408, and where,
a memory 406 for storing a computer program;
the processor 402, when executing the computer program stored in the memory 406, performs the following steps:
creating a cloud host as a control node and an operation node in a distributed cloud storage environment;
creating a timing test task in the cloud host;
writing a target time point of a script file and a file name of the script file, which are used for executing read-write performance tests on the computing nodes in the distributed cloud storage environment, in the timing test task;
running a query instruction, and determining that the timed test task is successfully established under the condition that the output result is successful in starting;
under the condition that the current time reaches the target time point, calling a target test tool to test the script file;
and after the script file is tested, exporting a test result of the script file.
Alternatively, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus. The communication interface is used for communication between the electronic equipment and other equipment.
The memory may include RAM, and may also include non-volatile memory, such as at least one disk memory. Alternatively, the memory may be at least one memory device located remotely from the aforementioned processor.
As an example, the memory 406 may include, but is not limited to, the first creating module 302, the second creating module 304, the writing module 306, the determining module 308, the calling module 310, and the deriving module 312 of the performance testing apparatus. In addition, the module may further include, but is not limited to, other module units in the processing apparatus of the request, which is not described in this example again.
The processor may be a general-purpose processor, and may include but is not limited to: a CPU (Central Processing Unit), an NP (Network Processor), and the like; but also a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 4 is only an illustration, and the device implementing the performance testing method may be a terminal device, and the terminal device may be a terminal device such as a smart phone (e.g., an Android Mobile phone, an iOS Mobile phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 4 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 4, or have a different configuration than shown in FIG. 4.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, and the like.
According to yet another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is executed by a processor to perform the steps in the performance testing method.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be substantially or partially implemented in the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, or network devices) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and amendments can be made without departing from the principle of the present invention, and these modifications and amendments should also be considered as the protection scope of the present invention.

Claims (10)

1. A method of performance testing, comprising:
creating a cloud host as a control node and an operation node in a distributed cloud storage environment;
creating a timing test task in the cloud host;
writing a target time point of a script file and a file name of the script file, which are used for executing read-write performance tests on the computing nodes in the distributed cloud storage environment, in the timing test task;
running a query instruction, and determining that the timing test task is successfully established under the condition that an output result is successful in starting;
under the condition that the current time reaches the target time point, calling a target test tool to test the script file;
and after the script file is tested, exporting a test result of the script file.
2. The method according to claim 1, wherein writing, in the timing test task, a target time point of a script file for performing read-write performance tests on computing nodes in the distributed cloud storage environment and a file name of the script file comprises:
creating target code in the timing test task;
under the condition that the script file is one, acquiring numerical values of date, time, minute and second of the target time point of the script file;
filling the acquired numerical 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 object code.
3. The method of claim 2, further comprising:
under the condition that a plurality of script files exist, taking each script file as a current script file, and executing the following operations on the current script file:
filling the numerical value of the target time point of the current script file into the target code, wherein the numerical value of the target time point of the current script file corresponds to the first position of the code line of the current script file;
and filling the file name of the current script file into the object code, wherein the second position of the code line corresponding to the current script file corresponds to one or more lines of code lines in the object code.
4. The method of claim 2, further comprising:
under the condition that a plurality of script files exist, filling the numerical value of the target time point of a first script file into the target code, filling the file name of the first script file into the target code, wherein the first position of a code line corresponding to the first script file is the second position of the code line corresponding to the first script file;
taking each script file except the first script file as a current script file, and executing the following operations on the current script file: acquiring a first numerical value of the target time point of a previous script file of the current script file; adding a test interval duration to the first numerical value to obtain a second numerical value of the target time point of the current script file, and filling the second numerical value into the target code, wherein the first position of the code line corresponds to the current script file; and filling the file name of the current script file into the target code, wherein the test interval duration is the test time interval of two adjacent script files in the plurality of script files.
5. The method according to any one of claims 1 to 4, wherein the deriving a test result of the script file after the script file is tested comprises:
acquiring a webpage address of the target testing tool for storing the testing result;
and exporting all data in the webpage address to a table file according to a table format.
6. The method according to any one of claims 1 to 4, wherein the deriving the test result of the script file after the script file is tested comprises:
acquiring a webpage address of the target testing tool for storing the testing result;
and exporting the data in the table format in the webpage address to a table file.
7. The method of claim 6, wherein exporting the data in the tabular format in the webpage address to a tabular file comprises:
identifying data in the web page address;
under the condition that a first keyword is identified, determining that the first keyword is initial data of data in a table format;
under the condition that a second keyword is identified, determining that the second keyword is ending data of the data in the table format;
exporting data between the start data and the end data into the table file.
8. A performance testing device, comprising:
the system comprises a first establishing module, a second establishing module and a third establishing module, wherein the first establishing module is used for establishing a cloud host which is used as a control node and an operation node in a distributed cloud storage environment;
the second establishing module is used for establishing a timing test task in the cloud host;
the writing module is used for writing a target time point of a script file and a file name of the script file, wherein the target time point is used for executing a read-write performance test on a computing node in the distributed cloud storage environment, in the timing test task;
the determining module is used for running the query instruction and determining that the timed test task is successfully established under the condition that the output result is successful in starting;
the calling module is used for calling a target testing tool to test the script file under the condition that the current time reaches the target time point;
and the exporting module is used for exporting the test result of the script file after the script file is tested.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202210557657.2A 2022-05-19 2022-05-19 Performance test method, device, storage medium and electronic equipment Pending CN114924940A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210557657.2A CN114924940A (en) 2022-05-19 2022-05-19 Performance test method, device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210557657.2A CN114924940A (en) 2022-05-19 2022-05-19 Performance test method, device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114924940A true CN114924940A (en) 2022-08-19

Family

ID=82811288

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210557657.2A Pending CN114924940A (en) 2022-05-19 2022-05-19 Performance test method, device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114924940A (en)

Similar Documents

Publication Publication Date Title
CN107193750B (en) Script recording method and device
CN108845930B (en) Interface operation test method and device, storage medium and electronic device
CN110554938B (en) BIOS (basic input output System) testing method, system, terminal and storage medium based on script set
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
CN113448862A (en) Software version testing method and device and computer equipment
CN107357721B (en) Method and device for testing system
CN112181822A (en) Test method and test method for starting time consumption of application program
CN109995931B (en) Method and device for realizing automatic calling
CN114924940A (en) Performance test method, device, storage medium and electronic equipment
CN110019262B (en) Data updating method and device
CN113157306A (en) Resource packaging management method, device, equipment and storage medium
CN113051178A (en) Test data construction method, device, equipment and medium
CN115514733A (en) Configuration method and configuration device for domain name resolution service (DNS)
CN112416750A (en) Application program boundary testing method and system
CN107193581B (en) Firmware upgrading method and device, storage medium and computer equipment
CN110865932A (en) Program internal interface testing method, system, terminal and storage medium
CN111240990A (en) ISMCLI command line testing method, system, terminal and storage medium
CN111597101A (en) SDK access state detection method, computer device and computer readable storage medium
CN109271188A (en) A kind of CPLD upgrade method and relevant apparatus
CN111880996B (en) Bare metal data acquisition method, device, equipment and readable storage medium
CN110555090B (en) Method, system, terminal and storage medium for automatically acquiring CPU BUS Number
CN116501414B (en) Resource control method, device, medium and computing equipment based on cloud platform
CN115390828A (en) Front-end function generation method, device, equipment and readable storage medium
CN117251361A (en) Method, device, equipment and storage medium for testing system stability
CN115525529A (en) Business object testing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination