[go: up one dir, main page]

CN113778851A - Method, apparatus, system, server and medium for stress testing - Google Patents

Method, apparatus, system, server and medium for stress testing Download PDF

Info

Publication number
CN113778851A
CN113778851A CN202110359766.9A CN202110359766A CN113778851A CN 113778851 A CN113778851 A CN 113778851A CN 202110359766 A CN202110359766 A CN 202110359766A CN 113778851 A CN113778851 A CN 113778851A
Authority
CN
China
Prior art keywords
service request
pressure measurement
data
target service
server
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
CN202110359766.9A
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 Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian 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 Jingdong Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202110359766.9A priority Critical patent/CN113778851A/en
Publication of CN113778851A publication Critical patent/CN113778851A/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/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Testing Of Devices, Machine Parts, Or Other Structures Thereof (AREA)

Abstract

本公开的实施例公开了用于压力测试的方法、装置、系统、服务器和介质。该方法的一具体实施方式包括:接收目标服务请求,其中,该目标服务请求用于指示对压测对象中的数据执行数据变更操作;确定该目标服务请求中是否包含用于指示压测数据的标识;响应于确定包含,对与该压测对象的环境一致的预设对象中的数据执行该目标服务请求所指示的数据变更操作;响应于接收到该预设对象反馈的数据变更结果,生成与该目标服务请求对应的响应信息。该实施方式实现了在不影响在线服务的前提下得到较为准确的压力测试结果。

Figure 202110359766

Embodiments of the present disclosure disclose methods, apparatus, systems, servers, and media for stress testing. A specific implementation of the method includes: receiving a target service request, wherein the target service request is used to instruct to perform a data change operation on the data in the pressure measurement object; determining whether the target service request contains a data used to indicate the pressure measurement data identification; in response to determining that it contains, perform the data change operation indicated by the target service request on the data in the preset object consistent with the environment of the stress test object; in response to receiving the data change result fed back by the preset object, generate Response information corresponding to the target service request. In this implementation manner, a relatively accurate stress test result can be obtained without affecting the online service.

Figure 202110359766

Description

Method, apparatus, system, server and medium for stress testing
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method, an apparatus, a system, a server, and a medium for pressure testing.
Background
With the development of internet technology, the data size is larger and larger. In order to improve the high concurrent and high available processing capacity of the system server and evaluate the stability of the system in a large-scale data scenario, various tests, such as a system stress test, a stability test, a load capacity test, an extensibility test, and the like, are generally required to be performed on the online service. In the prior art, test tools such as an apache meter and a loadrunner are often used, and multithreading concurrent access to a back-end service is performed by manually recording a test script, so that pressure brought by an online user accessing the back-end service is simulated.
However, in the process of stress test, if data is written into the cache or the database, many test data are generated, and the influence on normal data on the line may be generated; if data is not written in, a successful identifier is directly returned, the pressure test does not cover all the flows, and when the online flow is really written, a certain service or a certain module may have problems under the high concurrency condition, so that the whole flow is influenced.
Disclosure of Invention
Embodiments of the present disclosure propose methods, apparatuses, systems, servers, and media for stress testing.
In a first aspect, embodiments of the present disclosure provide a method for stress testing, the method comprising: receiving a target service request, wherein the target service request is used for indicating that data change operation is performed on data in a pressure measurement object; determining whether the target service request contains an identifier for indicating pressure measurement data; in response to determining to include, performing a data change operation indicated by the target service request on data in a preset object consistent with the environment of the pressure measurement object; and generating response information corresponding to the target service request in response to the received data change result fed back by the preset object.
In some embodiments, the receiving the target service request includes: generating first response information in response to receiving a first service request sent by a pressure measurement data sending end; sending the first response information to a pressure measurement data sending end; and in response to receiving a second service request sent by the pressure measurement data sending end, determining the second service request as a target service request, wherein the service corresponding to the second service request has a dependency relationship with the service corresponding to the first service request.
In some embodiments, the method further comprises: and in response to determining that the data is not contained, performing the data change operation indicated by the target service request on the data in the pressure measurement object.
In some embodiments, the pressure measurement object includes at least one of: redis service cluster, database, data table.
In some embodiments, the above consistent with the environment of the pressure measurement object includes: and the pressure measurement object runs in the same server and is configured in the same way.
In some embodiments, the above consistent with the environment of the pressure measurement object includes: the container specification and hardware performance of the server running in the system are consistent with those of the server running in the pressure measurement object and the configuration of the server is the same.
In a second aspect, embodiments of the present disclosure provide an apparatus for stress testing, the apparatus comprising: a receiving unit configured to receive a target service request, wherein the target service request is used for indicating that data change operation is performed on data in a pressure measurement object; a determination unit configured to determine whether an identifier indicating pressure measurement data is included in the target service request; a first execution unit configured to execute, in response to the determination of inclusion, a data change operation indicated by the target service request on data in a preset object that is consistent with the environment of the pressure measurement object; and the generating unit is configured to generate response information corresponding to the target service request in response to receiving the data change result fed back by the preset object.
In some embodiments, the receiving unit is further configured to: generating first response information in response to receiving a first service request sent by a pressure measurement data sending end; sending the first response information to a pressure measurement data sending end; and in response to receiving a second service request sent by the pressure measurement data sending end, determining the second service request as a target service request, wherein the service corresponding to the second service request has a dependency relationship with the service corresponding to the first service request.
In some embodiments, the apparatus for stress testing further comprises: and a second execution unit configured to execute the data change operation indicated by the target service request on the data in the pressure measurement object in response to determining that the data is not included.
In some embodiments, the pressure measurement object includes at least one of: redis service cluster, database, data table.
In some embodiments, the above consistent with the environment of the pressure measurement object includes: and the pressure measurement object runs in the same server and is configured in the same way.
In some embodiments, the above consistent with the environment of the pressure measurement object includes: the container specification and hardware performance of the server running in the system are consistent with those of the server running in the pressure measurement object and the configuration of the server is the same.
In a third aspect, an embodiment of the present application provides a system for pressure testing, including: the system comprises a pressure measurement data sending end, a pressure measurement data receiving end and a pressure measurement data sending end, wherein the pressure measurement data sending end is configured to send a target service request containing an identifier for indicating pressure measurement data to a server end to be tested; a server to be tested configured to execute the method described in any implementation manner of the first aspect; the client is configured to send a target service request which does not contain the identifier used for indicating the pressure measurement data to the server to be tested.
In some embodiments, the server to be tested is further configured to: sending response information corresponding to the target service request to a pressure measurement data sending end; and the pressure measurement data sending end is further configured to: in response to receiving response information corresponding to the target service request, a stress test result is generated.
In a fourth aspect, an embodiment of the present application provides a server, where the server includes: one or more processors; a storage device having one or more programs stored thereon; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.
In a fifth aspect, the present application provides a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
The method, the device, the system, the server and the medium for stress test provided by the embodiment of the disclosure convert the data change operation of the data for stress test in the stress test object into the data change operation in the preset object (such as a cache or a database with the same environment and configuration) consistent with the environment of the stress test object, and can obtain the stress test result basically similar to that of the online server because the environment and the configuration of the two are completely consistent; and because the pressure test data is thoroughly isolated from the on-line real data, the influence on the on-line real data is avoided, and the cleaning of the pressure test data in the later period is facilitated. Therefore, a relatively accurate pressure test result is obtained on the premise of not influencing on-line service.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow chart of one embodiment of a method for stress testing according to the present disclosure;
FIG. 3 is a schematic diagram of one application scenario of a method for stress testing in accordance with an embodiment of the present disclosure;
FIG. 4 is a flow chart of yet another embodiment of a method for stress testing according to the present disclosure;
FIG. 5 is a schematic structural diagram of one embodiment of an apparatus for stress testing according to the present disclosure;
FIG. 6 is a timing diagram of interactions between various devices in one embodiment of a system for stress testing according to the present application.
FIG. 7 is a schematic block diagram of an electronic device suitable for use in implementing embodiments of the present application.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary architecture 100 to which the method for stress testing or apparatus for stress testing of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, networks 104, 106, and servers 105, 107. Networks 104, 106 are the medium used to provide communication links between terminal devices 101, 102, 103 and server 105, and between server 105 and server 107, respectively. The networks 104, 106 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The terminal devices 101, 102, 103 interact with a server 105 via a network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a web browser application, a shopping-type application, a search-type application, an instant messaging tool, a mailbox client, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting human-computer interaction, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, such as a background server providing support for shopping-like applications on the terminal devices 101, 102, 103. The background server can analyze and process the received request, execute corresponding processing according to the request, and feed back a generated processing result (such as an order processing result) to the terminal device. The server 107 may be a server for stress testing the server 105. Various stress testing tools may be run on the server 107 and generate stress test results.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the method for stress testing provided by the embodiment of the present disclosure is generally performed by the server 105, and accordingly, the apparatus for stress testing is generally disposed in the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for stress testing in accordance with the present disclosure is shown. The method for pressure testing comprises the following steps:
step 201, receiving a target service request.
In the present embodiment, the execution subject of the method for stress testing (e.g., the server 105 shown in fig. 1) may receive the target service request through a wired connection manner or a wireless connection manner. The target service request may be used to instruct to perform a data change operation on data in the pressure measurement object. The data change operation may include, for example, an add, modify, or delete operation of data. The pressure test object described above may be used to indicate the object for which the pressure test is directed. Generally, the pressure measurement object can be various online service data systems.
In some optional implementations of this embodiment, the pressure measurement object may include at least one of: redis service cluster, database, data table.
Based on the optional implementation mode, the pressure test can be flexibly performed on the Redis service cluster serving as the system cache and the database or the data table in the database, and the flexibility of the pressure test object is improved.
Step 202, determining whether the target service request contains an identifier for indicating pressure measurement data.
In this embodiment, the execution subject may determine whether the target service request received in step 201 includes an identifier indicating pressure measurement data in various ways. As an example, the execution body may check a value (e.g., 0 or 1) corresponding to a preset field, and determine whether an identifier indicating pressure measurement data is included according to the value.
It should be noted that, in order to avoid confusion of on-line real data caused by data used by the pressure test tool, the data used for the pressure test may be made to carry a flag indicating the pressure test data, and the execution main body of the method for the pressure test has a function of recognizing the flag and transmitting the flag.
Step 203, responding to the determination, executing data change operation indicated by the target service request on the data in the preset object consistent with the environment of the pressure measurement object.
In this embodiment, in response to determining to include, the execution subject may execute a data change operation indicated by the target service request on data in a preset object that is consistent with the environment of the pressure measurement object. The preset object can be generally regarded as a copy of an environment design referring to the pressure measurement object (such as a data system served online). As an example, when the pressure measurement object is an online Redis server cluster, the preset object may be the same cluster deployed with reference to the online Redis server cluster. As another example, when the pressure measurement object is an online database or a table structure in the database, the preset object may be the same database or a table structure in the database deployed with reference to the online database.
In some optional implementations of the present embodiment, the pressure measurement object includes at least one of the following items: the Redis service cluster, the database and the data table, which are consistent with the environment of the pressure measurement object, may include: and the pressure measurement object runs in the same server and has the same configuration.
In these implementations, as an example, when the above-mentioned pressure measurement object is a Redis service cluster, the correspondence with the environment of the above-mentioned pressure measurement object may refer to: and redeploying and configuring the same service cluster on the server running the pressure measurement object. As another example, when the pressure measurement object is an online database or a table structure in a database, the correspondence with the environment of the pressure measurement object may refer to: and re-deploying and configuring the same online database or a table structure in the database on a server running the pressure measurement object.
In some optional implementations of the present embodiment, the pressure measurement object includes at least one of the following items: the Redis service cluster, the database and the data table, which are consistent with the environment of the pressure measurement object, may include: the container specification and hardware performance of the server running in the system are consistent with those of the server running in the pressure measurement object and are configured in the same way.
In these implementations, as an example, when the above-mentioned pressure measurement object is a Redis service cluster, the correspondence with the environment of the above-mentioned pressure measurement object may refer to: and redeploying the service cluster with the same configuration on the server with the same container specification and hardware performance as the server running the pressure measurement object. As another example, when the pressure measurement object is an online database or a table structure in a database, the correspondence with the environment of the pressure measurement object may refer to: and redeploying and configuring the same online database or the table structure in the database on the server with the same container specification and hardware performance as the server running the pressure measurement object. Specifically, if the table structures are in the same database, only the same configuration needs to be made for the table structures; if the table structure is in different databases, it is necessary to ensure that the new database is deployed on a server having the same container specification and hardware performance as the server running the pressure measurement object.
And step 204, responding to the received data change result fed back by the preset object, and generating response information corresponding to the target service request.
In this embodiment, in response to receiving the data change result fed back by the preset object, the execution main body may generate response information corresponding to the target service request. The response information may be used to indicate whether the data change operation is successfully executed.
In this embodiment, the preset object may generate information indicating whether the data change operation is successfully performed after the data change operation indicated by the target service request is performed. Based on the information, the executing agent may generate response information corresponding to the target service request.
In some optional implementations of this embodiment, the executing body may further continue to perform the following steps:
and in response to determining that the data is not contained, performing the data change operation indicated by the target service request on the data in the pressure measurement object.
In these implementations, in response to determining not to include, the execution principal may perform a data change operation indicated by the target service request on data in the pressure measurement object.
Alternatively, the execution main body may further transmit information representing an execution result of a data change operation indicated by a target service request for data in the pressure measurement object to an electronic device (for example, a client) that transmits the target service request that does not include the identifier.
Based on the optional implementation mode, the scheme can perform pressure test without influencing normal processing of online data.
In some optional implementation manners of this embodiment, the execution main body may further send the generated response information corresponding to the target service request to the pressure measurement data sending end, so that the pressure measurement data sending end generates a pressure measurement result.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of a method for stress testing according to an embodiment of the present disclosure. In the application scenario of fig. 3, the server 301 running the backend service pressure script 3011 may send a target service request to the server to be tested 302 providing the online service 3021. The target service request may be, for example, a data write request with a pressure measurement data identifier. The server 302 determines that the target service request includes an identifier indicating pressure measurement data. Then, the server 302 may write the data indicated by the above-described target service request to the preset object 3023 that coincides with the environment of the pressure measurement object 3022. The pressure measurement object 3022 may be, for example, various data management systems. Then, in response to receiving the information for representing successful data storage fed back by the preset object 3023, the server 302 may generate information for representing successful data writing as response information corresponding to the target service request. Alternatively, the user 303 may use a terminal device 304 (e.g., App side) or a terminal device 305 (e.g., PC side) to send a service request containing no identification indicating pressure measurement data to the server 302 providing an online service. The server 302 may perform a corresponding operation on the pressure measurement object 3022 according to the service request that does not include the identifier indicating the pressure measurement data.
At present, one of the prior art generally writes data generated by a stress test into a cache or a database directly, resulting in the risk of affecting normal data on a line; the prior art also adopts a method of directly replacing the real written data with the returned successful identification, so that the stress test does not cover all the flows. In the method provided by the above embodiment of the present disclosure, by converting the data change operation of the data for the stress test in the stress test object into the data change operation in the preset object (for example, a cache or a database with the same environment and configuration) consistent with the environment of the stress test object, since the environment and configuration of the two are completely consistent, the stress test result substantially similar to that of the online server can be obtained; and because the pressure test data is thoroughly isolated from the on-line real data, the influence on the on-line real data is avoided, and the cleaning of the pressure test data in the later period is facilitated. Therefore, a relatively accurate pressure test result is obtained on the premise of not influencing on-line service.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for stress testing is shown. The process 400 of the method for stress testing includes the steps of:
step 401, in response to receiving a first service request sent by a pressure measurement data sending end, generating first response information.
In this embodiment, in response to receiving the first service request sent by the pressure test data sending end, the execution subject of the method for pressure testing (e.g., the server 105 shown in fig. 1) may generate the first response information in various ways. The first service request may include various requests for indicating services that the execution agent can provide. As an example, the first service request may be a login request, for example. As yet another example, the first service request may be, for example, a query request for data.
In this embodiment, the executing entity may execute a corresponding operation according to the first service request, so as to generate the first response information. As an example, the first response information may be information for characterizing whether the login is successful or not, for example. As still another example, the first response information may be, for example, information for characterizing whether data to be queried exists.
And 402, sending the first response information to a pressure measurement data sending end.
In this embodiment, the executing entity may send the first response information generated in step 401 to the pressure measurement data sending end. The pressure measurement data sending end may be, for example, the server 107 in fig. 1.
And step 403, in response to receiving the second service request sent by the pressure measurement data sending end, determining the second service request as a target service request.
In this embodiment, in response to receiving a second service request sent by a pressure measurement data sending end, the execution main body may determine the second service request as a target service request. And the service corresponding to the second service request and the service corresponding to the first service request have a dependency relationship. In general, the service corresponding to the first service request is dependent on the service corresponding to the second service request, that is, the execution of the service corresponding to the second service request needs to depend on the execution result of the service corresponding to the first service request.
As an example, based on the first service request being a login request, the second service request may be a request for adding commodity information or a web page to a collection, for example. As another example, the second service request may be a request for deleting queried data based on the first service request being a data query request.
It should be noted that, for a service having a dependency relationship, the pressure test data sending end may perform a serial test on a plurality of services. For example, the pressure measurement data sending end may first send a first service request to the execution main body, and the execution main body may generate first response information based on a result returned by a service corresponding to the first service request. Then, in response to receiving the first response message sent by the execution main body, the pressure measurement data sending end may send the second service request to the execution main body according to the first response message.
Step 404, determine whether the target service request includes an identifier indicating pressure measurement data.
Step 405, in response to determining to include, performing a data change operation indicated by the target service request on data in the preset object consistent with the environment of the pressure measurement object.
And step 406, in response to receiving the data change result fed back by the preset object, generating response information corresponding to the target service request.
Step 404, step 405, and step 406 are respectively consistent with step 202, step 203, step 204 and their optional implementations in the foregoing embodiments, and the above description of step 202, step 203, step 204 and their optional implementations also applies to step 404, step 405, and step 406, which is not described herein again.
As can be seen from fig. 4, the flow 400 of the method for pressure testing in this embodiment represents a step of receiving a service request sent by a pressure test data sending end for indicating a service with a dependency relationship. Therefore, the scheme described in this embodiment can implement the full link pressure test on the service having the dependency relationship in the backend server by receiving the first service request and the second service request and performing corresponding processing.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an apparatus for stress testing, which corresponds to the method embodiment shown in fig. 2 or fig. 4, and which may be applied in various electronic devices in particular.
As shown in fig. 5, the apparatus 500 for stress test provided by the present embodiment includes a receiving unit 501, a determining unit 502, a first executing unit 503, and a generating unit 504. The receiving unit 501 is configured to receive a target service request, where the target service request is used to instruct to perform a data change operation on data in a pressure measurement object; a determining unit 502 configured to determine whether the target service request includes an identifier indicating pressure measurement data; a first execution unit 503 configured to, in response to the determination of inclusion, execute a data change operation indicated by the target service request on data in a preset object that is consistent with the environment of the pressure measurement object; a generating unit 504 configured to generate response information corresponding to the target service request in response to receiving the data change result fed back by the preset object.
In the present embodiment, in the apparatus for pressure test 500: the specific processing of the receiving unit 501, the determining unit 502, the first executing unit 503 and the generating unit 504 and the technical effects thereof can refer to the related descriptions of step 201, step 202, step 203 and step 204 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the receiving unit may be further configured to: generating first response information in response to receiving a first service request sent by a pressure measurement data sending end; sending the first response information to a pressure measurement data sending end; and in response to receiving a second service request sent by the pressure measurement data sending end, determining the second service request as a target service request, wherein the service corresponding to the second service request has a dependency relationship with the service corresponding to the first service request.
In some optional implementations of the present embodiment, the apparatus 500 for pressure testing may further include: and a second execution unit (not shown in the figure) configured to execute the data change operation indicated by the target service request on the data in the pressure measurement object in response to determining that the data is not included.
In some optional implementations of this embodiment, the pressure measurement object may include at least one of: redis service cluster, database, data table.
In some optional implementations of the present embodiment, the coinciding with the environment of the pressure measurement object may include: and the pressure measurement object runs in the same server and is configured in the same way.
In some optional implementations of the present embodiment, the coinciding with the environment of the pressure measurement object may include: the container specification and hardware performance of the server running in the system are consistent with those of the server running in the pressure measurement object and the configuration of the server is the same.
The apparatus provided by the above embodiment of the present disclosure converts the data change operation of the data for stress test received by the receiving unit 501 by the first executing unit 503 in the stress test object into the data change operation in the preset object (for example, the buffer or the database with the same environment and configuration) consistent with the environment of the stress test object, so that the stress test result substantially similar to that of the online server can be obtained because the environment and configuration of the two are completely consistent; and because the pressure test data is thoroughly isolated from the on-line real data, the influence on the on-line real data is avoided, and the cleaning of the pressure test data in the later period is facilitated. Therefore, a relatively accurate pressure test result is obtained on the premise of not influencing on-line service.
With further reference to FIG. 6, a timing sequence 600 of interactions between various devices in one embodiment of a method for stress testing is illustrated. The system for stress testing may include: a pressure test data sending end (for example, the server 107 shown in fig. 1), a server to be tested (for example, the server 105 shown in fig. 1), and a client (for example, the terminal devices 101, 102, 103 shown in fig. 1). The pressure measurement data sending terminal may be configured to send a target service request including an identifier indicating pressure measurement data to a server to be tested. The server to be tested may be configured to execute the method for pressure testing as described in the foregoing embodiments. The client side can be configured to send a target service request which does not contain an identifier for indicating pressure measurement data to a server side to be tested.
In some optional implementations of this embodiment, the server to be tested may be further configured to: and sending the response information corresponding to the target service request to a pressure measurement data sending end. The pressure measurement data sending end can be further configured to: in response to receiving response information corresponding to the target service request, a stress test result is generated.
As shown in fig. 6, in step 601, the client sends a target service request that does not include an identifier indicating pressure measurement data to the server to be tested.
In this embodiment, the client (for example, the terminal devices 101, 102, 103 in fig. 1) may send a target service request that does not include an identifier indicating pressure measurement data to the server to be tested. The target service request not containing the identifier indicating the pressure measurement data may be an online real service request, such as a user login request, an order generation request, or the like.
In step 602, the pressure measurement data sending end sends a target service request including an identifier for indicating pressure measurement data to a server to be tested.
In this embodiment, a pressure measurement data sending end (for example, the server 107 in fig. 1) may send a target service request including an identifier indicating pressure measurement data to a server to be tested. The pressure measurement data sending end can be a server end running various pressure measurement tools. In order to distinguish from the online real request, the target service request sent by the pressure measurement data sending end generally carries an identifier for indicating the pressure measurement data.
In some optional implementations of this embodiment, the pressure measurement data sending end may also be consistent with the corresponding description in step 403 in the foregoing embodiment, and details are not described here again.
In step 603, the server to be tested receives the target service request.
In step 604, the server to be tested determines whether the target service request includes an identifier indicating pressure measurement data.
In step 605, in response to determining to include, the server to be tested performs a data change operation indicated by the target service request on data in the preset object consistent with the environment of the pressure test object.
In step 606, in response to receiving the data change result fed back by the preset object, the server to be tested generates response information corresponding to the target service request.
Steps 603 to 606 are respectively consistent with steps 201 to 204 in the foregoing embodiment and their optional implementation manners, and corresponding steps in the embodiment of fig. 4, and the above descriptions regarding steps 201 to 204 and their optional implementation manners, and corresponding steps in the embodiment of fig. 4 are also applicable to steps 603 to 606, which are not described again here.
In some optional implementation manners of this embodiment, in step 607, the server to be tested may send response information corresponding to the target service request to the pressure measurement data sending end.
In some optional implementations of this embodiment, in step 608, in response to receiving the response information corresponding to the target service request, the pressure test data sending end may generate a pressure test result.
In these implementations, the pressure test data sending end may generate the pressure test result in various ways according to the received response information. Wherein the pressure test result may be used to indicate at least one of: system limit performance, system throughput, database read-write capability, and database response time.
In the system for pressure testing provided by the above embodiment of the present application, first, the pressure measurement data sending end and the client send target service requests including or not including the identifier for indicating the pressure measurement data to the server to be tested, respectively. And then, the server to be tested responds to the received target service request and determines that the received target service request contains an identifier for indicating pressure measurement data, and data change operation indicated by the target service request is executed on data in a preset object consistent with the environment of the pressure measurement object. And responding to the received data change result fed back by the preset object, and generating response information corresponding to the target service request by the server to be tested. And in response to determining that the data is not contained, the server to be tested performs the data change operation indicated by the target service request on the data in the pressure test object. Therefore, a pressure test result basically similar to that of the on-line server can be obtained, and because the pressure test data is thoroughly isolated from the on-line real data, the influence on the on-line real data is avoided, and the cleaning of the pressure test data in the later period is facilitated. The accurate pressure test result can be obtained on the premise of not influencing on-line service.
Referring now to FIG. 7, a block diagram of an electronic device (e.g., server 105 of FIG. 1) 700 suitable for use in implementing embodiments of the present application is shown. The server shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 7 may represent one device or may represent multiple devices as desired.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 708, or may be installed from the ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of the embodiments of the present application.
It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately and not be assembled into the server. The computer readable medium carries one or more programs which, when executed by the server, cause the server to: receiving a target service request, wherein the target service request is used for indicating that data change operation is performed on data in a pressure measurement object; determining whether the target service request contains an identifier for indicating pressure measurement data; in response to determining to include, performing a data change operation indicated by the target service request on data in a preset object consistent with the environment of the pressure measurement object; and generating response information corresponding to the target service request in response to the received data change result fed back by the preset object.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as "C", Python, or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, a determining unit, a first executing unit, and a generating unit. The names of these units do not form a limitation on the unit itself in some cases, and for example, the receiving unit may also be described as a unit that receives a target service request indicating that a data change operation is performed on data in a pressure measurement object.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (11)

1. A method for stress testing, comprising:
receiving a target service request, wherein the target service request is used for indicating that data change operation is performed on data in a pressure measurement object;
determining whether the target service request contains an identifier for indicating pressure measurement data;
in response to determining to include, performing a data change operation indicated by the target service request on data in a preset object consistent with the environment of the pressure measurement object;
and responding to the received data change result fed back by the preset object, and generating response information corresponding to the target service request.
2. The method of claim 1, wherein the receiving a target service request comprises:
generating first response information in response to receiving a first service request sent by a pressure measurement data sending end;
sending the first response information to the pressure measurement data sending end;
and in response to receiving a second service request sent by the pressure measurement data sending end, determining the second service request as the target service request, wherein the service corresponding to the second service request has a dependency relationship with the service corresponding to the first service request.
3. The method of claim 1, wherein the method further comprises:
and in response to determining that the data is not contained, performing the data change operation indicated by the target service request on the data in the pressure measurement object.
4. The method according to one of claims 1-3, wherein the pressure measurement object comprises at least one of: redis service cluster, database, data table.
5. The method of claim 4, wherein said conforming to the environment of the pressure measurement object comprises: and the pressure measurement object runs in the same server and has the same configuration.
6. The method of claim 4, wherein said conforming to the environment of the pressure measurement object comprises: the container specification and the hardware performance of the server running in the pressure measurement system are consistent with those of the server running in the pressure measurement object and are configured identically.
7. An apparatus for stress testing, comprising:
a receiving unit configured to receive a target service request, wherein the target service request is used for indicating that data change operation is performed on data in a pressure measurement object;
a determination unit configured to determine whether an identifier indicating pressure measurement data is included in the target service request;
a first execution unit configured to, in response to determining to include, execute a data change operation indicated by the target service request on data in a preset object that is consistent with an environment of the pressure measurement object;
a generating unit configured to generate response information corresponding to the target service request in response to receiving a data change result fed back by the preset object.
8. A system for stress testing, comprising:
the system comprises a pressure measurement data sending end, a pressure measurement data receiving end and a pressure measurement data sending end, wherein the pressure measurement data sending end is configured to send a target service request containing an identifier for indicating pressure measurement data to a server end to be tested;
the server to be tested is configured to execute the method according to any one of claims 1 to 5;
the client is configured to send a target service request which does not contain the identifier for indicating the pressure measurement data to the server to be tested.
9. The system of claim 8, wherein the service to be tested is further configured to: sending the response information corresponding to the target service request to the pressure measurement data sending end; and
the pressure measurement data transmitting end is further configured to:
generating a stress test result in response to receiving response information corresponding to the target service request.
10. A server, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
11. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202110359766.9A 2021-04-02 2021-04-02 Method, apparatus, system, server and medium for stress testing Pending CN113778851A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110359766.9A CN113778851A (en) 2021-04-02 2021-04-02 Method, apparatus, system, server and medium for stress testing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110359766.9A CN113778851A (en) 2021-04-02 2021-04-02 Method, apparatus, system, server and medium for stress testing

Publications (1)

Publication Number Publication Date
CN113778851A true CN113778851A (en) 2021-12-10

Family

ID=78835618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110359766.9A Pending CN113778851A (en) 2021-04-02 2021-04-02 Method, apparatus, system, server and medium for stress testing

Country Status (1)

Country Link
CN (1) CN113778851A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108959087A (en) * 2018-06-29 2018-12-07 百度在线网络技术(北京)有限公司 test method and device
CN109871320A (en) * 2019-01-21 2019-06-11 上海德启信息科技有限公司 A kind of data processing method, device, application server and storage medium
WO2020238345A1 (en) * 2019-05-31 2020-12-03 深圳前海微众银行股份有限公司 Pressure test method, device, system, apparatus, and computer readable storage medium
CN112131095A (en) * 2019-06-25 2020-12-25 北京京东振世信息技术有限公司 Pressure testing method and device
CN112363879A (en) * 2020-11-20 2021-02-12 上海连尚网络科技有限公司 Cache server performance test method, device, equipment and medium
WO2021042914A1 (en) * 2019-09-02 2021-03-11 深圳壹账通智能科技有限公司 Test data generation method and apparatus, computer device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108959087A (en) * 2018-06-29 2018-12-07 百度在线网络技术(北京)有限公司 test method and device
CN109871320A (en) * 2019-01-21 2019-06-11 上海德启信息科技有限公司 A kind of data processing method, device, application server and storage medium
WO2020238345A1 (en) * 2019-05-31 2020-12-03 深圳前海微众银行股份有限公司 Pressure test method, device, system, apparatus, and computer readable storage medium
CN112131095A (en) * 2019-06-25 2020-12-25 北京京东振世信息技术有限公司 Pressure testing method and device
WO2021042914A1 (en) * 2019-09-02 2021-03-11 深圳壹账通智能科技有限公司 Test data generation method and apparatus, computer device and storage medium
CN112363879A (en) * 2020-11-20 2021-02-12 上海连尚网络科技有限公司 Cache server performance test method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
CN112597047B (en) Test method, test device, electronic equipment and computer readable medium
US10078579B1 (en) Metrics-based analysis for testing a service
CN111666201A (en) Regression testing method, device, medium and electronic equipment
CN110888794A (en) Interface test method and device
CN111506904A (en) Method and device for online vulnerability repair
CN112559024A (en) Method and device for generating transaction code change list
CN110866031B (en) Database access path optimization method and device, computing equipment and medium
CN111966653A (en) Data processing method, device, server and storage medium for micro-service call link
US10382311B2 (en) Benchmarking servers based on production data
CN113238940B (en) Interface test result comparison method, device, equipment and storage medium
CN112084114B (en) Method and apparatus for testing interfaces
CN112579428B (en) Interface testing method, device, electronic equipment and storage medium
CN114168485A (en) Test method, device, equipment and medium
CN111290942A (en) Pressure testing method, device and computer readable medium
CN113704079A (en) Interface testing method and device based on Protobuf
CN109144864B (en) Method and device for testing window
CN111338834A (en) Data storage method and device
CN113778851A (en) Method, apparatus, system, server and medium for stress testing
CN113760680B (en) A method and device for testing system pressure performance
CN112988560B (en) Method and device for testing system robustness
CN116467156A (en) Joint debugging test method and device, storage medium and electronic equipment
CN113760715A (en) Method and device for testing system
CN113254325A (en) Test case processing method and device
CN111831530A (en) Test method and apparatus

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