CN111343048B - Pressure testing method and device, computer device and storage medium - Google Patents

Pressure testing method and device, computer device and storage medium Download PDF

Info

Publication number
CN111343048B
CN111343048B CN202010131536.2A CN202010131536A CN111343048B CN 111343048 B CN111343048 B CN 111343048B CN 202010131536 A CN202010131536 A CN 202010131536A CN 111343048 B CN111343048 B CN 111343048B
Authority
CN
China
Prior art keywords
test
task
client
clients
identifier
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.)
Active
Application number
CN202010131536.2A
Other languages
Chinese (zh)
Other versions
CN111343048A (en
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.)
Shenzhen Onething Technology Co Ltd
Original Assignee
Shenzhen Onething 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 Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN202010131536.2A priority Critical patent/CN111343048B/en
Publication of CN111343048A publication Critical patent/CN111343048A/en
Application granted granted Critical
Publication of CN111343048B publication Critical patent/CN111343048B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/06Generation of reports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a pressure testing method, which comprises the following steps: creating a stress test task, wherein the stress test task comprises a task identifier, a plurality of client identifiers, a test scale, address information of a service node and test contents; selecting a plurality of target clients for executing the pressure test task from a plurality of clients in a distributed system according to the pressure test task; sending the pressure test task to the target clients, so that the target clients send test requests to the service node according to the address information and the test content, and the target clients store test results in the distributed system according to the task identification; and acquiring the test result from the distributed system according to the task identifier, and generating a test report. The invention also provides a pressure testing device, a computer device and a computer readable storage medium. The invention performs pressure test on the service node running the software system.

Description

Pressure testing method and device, computer device and storage medium
Technical Field
The present invention relates to the field of testing, and in particular, to a pressure testing method and apparatus, a computer apparatus, and a computer readable storage medium.
Background
The service node running the e-commerce software system may provide payment services, order services, etc. to the user. The service node running the video software system may provide video download services, online viewing services, etc. to the user. In general, a service node running a software system has the characteristics of large user quantity and high concurrency, and in order to ensure the service performance of the service node, a reliable stress test method is needed to perform stress test on the service node running the software system.
Disclosure of Invention
In view of the foregoing, it is necessary to propose a stress testing method, a stress testing device, a computer readable storage medium, which can stress test a service node running a software system.
A first aspect of the present application provides a pressure testing method applied to a computer device in a distributed system, the method comprising:
creating a stress test task, wherein the stress test task comprises a task identifier, a plurality of client identifiers, a test scale, address information of a service node and test contents;
selecting a plurality of target clients for executing the pressure test task from a plurality of clients in the distributed system according to the pressure test task;
Sending the pressure test task to the target clients, so that the target clients send test requests to the service node according to the address information and the test content, and the target clients store test results in the distributed system according to the task identification;
and acquiring the test result from the distributed system according to the task identifier, and generating a test report.
In another possible implementation manner, the creating the stress test task includes:
acquiring the plurality of client identifiers stored by the computer device;
receiving the input test scale, test content and address information;
encrypting the test scale, the test content and/or the address information to obtain the task identifier;
and combining the task identifier, the plurality of client identifiers, the test scale, the address information of the service node and the test content to obtain the stress test task.
In another possible implementation manner, the selecting, according to the stress test task, a plurality of target clients that perform the stress test task from a plurality of clients that are located in the distributed system includes:
Acquiring a preset identification value range;
and selecting a client with the client identifier contained in the preset identifier value range from the plurality of clients as the target client.
In another possible implementation manner, the selecting, according to the stress test task, a plurality of target clients that perform the stress test task from a plurality of clients that are located in the distributed system includes:
acquiring a preset identification value range;
selecting a plurality of intermediate clients with client identifiers contained in the preset identifier value range from the plurality of clients;
adjusting the preset identification value range according to the number of the plurality of intermediate clients and the test scale;
and selecting the client with the client identifier contained in the adjusted identifier value range as the target client.
In another possible implementation manner, the obtaining the test result from the distributed system according to the task identifier includes:
determining a client storing the test result from the distributed system according to the task identifier;
and acquiring the test result from the determined client.
In another possible implementation manner, the method further includes:
Receiving the test results returned by the target clients;
and storing the test result in the distributed system according to the task identifier.
In another possible implementation manner, the method further includes:
and adjusting the number of the target clients according to the test report.
A second aspect of the present application provides a computer apparatus comprising a memory and a processor, the memory having stored thereon a computer program executable on the processor, the computer program implementing the pressure test method when executed by the processor.
A third aspect of the present application provides a pressure testing apparatus, the apparatus comprising:
the system comprises a creation unit, a test unit and a test unit, wherein the creation unit is used for creating a stress test task, and the stress test task comprises a task identifier, a plurality of client identifiers, a test scale, address information of a service node and test contents;
the selecting unit is used for selecting a plurality of target clients for executing the pressure test task from a plurality of clients in the distributed system according to the pressure test task;
the sending unit is used for sending the pressure test task to the target clients, so that the target clients send test requests to the service node according to the address information and the test content, and the target clients store test results in the distributed system according to the task identification;
And the acquisition unit is used for acquiring the test result from the distributed system according to the task identifier and generating a test report.
In another possible implementation manner, the creating the stress test task includes:
acquiring the plurality of client identifiers stored by the computer device;
receiving the input test scale, test content and address information;
encrypting the test scale, the test content and/or the address information to obtain the task identifier;
and combining the task identifier, the plurality of client identifiers, the test scale, the address information of the service node and the test content to obtain the stress test task.
In another possible implementation manner, the selecting, according to the pressure test task, a plurality of target clients that perform the pressure test task from a plurality of clients that are located in a distributed system includes:
acquiring a preset identification value range;
and selecting a client with the client identifier contained in the preset identifier value range from the plurality of clients as the target client.
In another possible implementation manner, the selecting, according to the pressure test task, a plurality of target clients that perform the pressure test task from a plurality of clients that are located in a distributed system includes:
Acquiring a preset identification value range;
selecting a plurality of intermediate clients with client identifiers contained in the preset identifier value range from the plurality of clients;
adjusting the preset identification value range according to the number of the plurality of intermediate clients and the test scale;
and selecting the client with the client identifier contained in the adjusted identifier value range as the target client.
In another possible implementation manner, the obtaining the test result from the distributed system according to the task identifier includes:
determining a client storing the test result from the distributed system according to the task identifier;
and acquiring the test result from the determined client.
In another possible implementation manner, the pressure testing device further includes a storage unit, configured to receive the test results returned by the multiple target clients; and storing the test result in the distributed system according to the task identifier.
In another possible implementation manner, the pressure testing device further includes an adjusting unit, configured to adjust the number of the plurality of target clients according to the test report.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the pressure testing method.
The method comprises the steps of creating a stress test task, wherein the stress test task comprises a task identifier, a plurality of client identifiers, a test scale, address information of the service node and test contents; selecting a plurality of target clients for executing the pressure test task from a plurality of clients in the distributed system according to the pressure test task; sending the pressure test task to the target clients, so that the target clients send test requests to the service node according to the address information and the test content, and the target clients store test results in the distributed system according to the task identification; and acquiring the test result from the distributed system according to the task identifier, and generating a test report. The pressure test method can be used for performing pressure test on the service node running the software system.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of a pressure testing method according to an embodiment of the present invention.
FIG. 2 is a flow chart of a preferred embodiment of a pressure testing apparatus according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of a preferred embodiment of a computer device according to an embodiment of the invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims of this application and in the above-described figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or device.
Preferably, the pressure testing method of the present invention is applied in one or more computer devices. The computer apparatus is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable gate array (Field-Programmable Gate Array, FPGA), a digital processor (Digital Signal Processor, DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer device can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The computer device may be a node constituting a CDN (Content Delivery Network ) network or a blockchain network.
Example 1
Fig. 1 is a flowchart of a pressure testing method according to an embodiment of the present invention. The pressure testing method is applied to the computer device in the distributed system and is used for carrying out pressure testing on the service node running the software system.
Referring to fig. 1, the pressure testing method specifically includes the following steps:
101, creating a stress test task, wherein the stress test task comprises a task identifier, a plurality of client identifiers, a test scale, address information of the service node and test contents.
In a specific embodiment, the creating the stress test task includes:
acquiring the plurality of client identifiers stored by the computer device;
receiving the input test scale, the test content and the address information of the service node;
encrypting the test scale, the test content and/or the address information to obtain the task identifier;
and combining the task identifier, the plurality of client identifiers, the test scale, the address information of the service node and the test content to obtain the pressure test task.
The plurality of client identities may be IDs, IP (Internet Protocol ) addresses and/or MAC (Media Access Control ) addresses of a plurality of computer terminals or mobile phone terminals, etc.
The test scale may include the number of clients and/or the duration of the test, etc.
The test content may include a character string (the plurality of client terminals may test the service node according to a local interface request corresponding to the character string) or an interface request. The interface request may be a create transaction request and/or a payment request to a linux server running an e-commerce software system; the interface request can be a video download request and/or a video online watching request of a linux server running a video software system; the interface request may also be a login request and/or a reward request to a linux server running a live software system.
The address information may be an IP address, port and/or MAC address of the serving node, etc. The service node may be a linux server.
The encryption algorithm that encrypts the test scale, the test content and/or the address information may be SHA256, SHA384 or SHA512, etc. A target character string composed of the test scale, the test content and/or the address information can be acquired; and encrypting the target character string by adopting an SHA256 algorithm to obtain a hash value of the target character string.
The task identity, the plurality of client identities, the test scale, the address information of the service node and the test content may be combined in key-value form or XML form to obtain the stress test task.
102, selecting a plurality of target clients for executing the pressure test task from a plurality of clients located in the distributed system according to the pressure test task.
In a specific embodiment, the selecting, according to the pressure test task, a plurality of target clients for executing the pressure test task from a plurality of clients located in the distributed system includes:
acquiring a preset identification value range;
And selecting a client with the client identifier contained in the preset identifier value range from the plurality of clients as the target client.
For example, the client identifier may be a 16-ary 4-bit character string, and the preset identifier value range may be 0000-000f; the client identifiers of the three clients are 0001, 000a and 00c6 respectively, and the clients with the client identifiers of 0001 and 000a are selected as a plurality of target clients, wherein the preset identifier value range 0000-000f comprises 0001 and 000a.
For another example, the client identifier may be a 16-ary 64-bit string, and the preset identifier value range may be the 63 rd and 64 th value ranges of the client identifier: 00-0f; the client identifiers of the three clients are fa, 9a and 06 respectively, the client with the client identifier of 06 is selected as a target client, and the preset identifier value range 00-0f comprises 06.
In another embodiment, the selecting, according to the stress test task, a plurality of target clients for executing the stress test task from a plurality of clients located in the distributed system includes:
acquiring a preset identification value range;
selecting a client with the client identifier contained in the preset identifier value range from the plurality of clients to determine the client as a plurality of intermediate clients;
Adjusting the preset identification value range according to the number of the plurality of intermediate clients and the test scale;
and selecting the client with the client identifier contained in the adjusted identifier value range as the target client.
For example, the client identifier may be a 16-ary 64-bit string, and the preset identifier value range may be the 63 rd and 64 th value ranges of the client identifier: 00-0f; selecting 100 intermediate clients from the plurality of clients; the number of clients in the test scale is 50, the number of intermediate clients is larger than the number of clients in the test scale, the preset identification value range is reduced, the number of intermediate clients is close to the number of clients in the test scale, and the adjusted identification value range is obtained; and selecting the client with the client identifier contained in the adjusted identifier value range from the plurality of clients as a plurality of target clients.
103, sending the pressure test task to the target clients, enabling the target clients to send test requests to the service node according to the address information and the test content, and enabling the target clients to store test results in the distributed system according to the task identification.
The stress test tasks may be sent to the plurality of target clients by get or post methods. The target clients can generate test requests according to the test contents and send the test requests to the service node according to the address information. And the service node returns processing results to the target clients in response to the test request. And the plurality of target clients receive the processing results, generate test results and store the test results in a distributed system.
The test results may include response time, task processing time consumption, whether the test was successful, etc. The test results may be in json format.
104, obtaining the test result from the distributed system according to the task identifier, and generating a test report.
In a specific embodiment, the obtaining the test result from the distributed system according to the task identifier includes:
determining a client storing the test result from the distributed system according to the task identifier;
and acquiring the test result from the determined client.
Each client in the distributed system has a client identification code, which can be obtained by performing hash calculation on the IP address and/or the MAC address of the client. The hash calculation method of the client identification code may be the same as the hash calculation method of the task identification. Routing information of the plurality of clients may be included in a routing table of the computer apparatus.
An exclusive or distance between the task identification and client identification codes of a plurality of clients in a routing table of the computer device can be calculated; selecting a plurality of clients with small exclusive or distances from the task identification code from a routing table of the computer device as query clients, and iteratively querying the query clients for index information of the task identification code until the index information of the task identification code is received, wherein the index information of the task identification code comprises the task identification code (i.e. key keys in key-value key value pairs) and routing information (i.e. value values in key-value key value pairs) of the clients storing the test results; and determining the client which stores the test result according to the routing information. The determined client may be connected via a TCP (Transmission Control Protocol ) or UDP (User Datagram Protocol, user datagram protocol) protocol. The test results may be obtained from the determined clients through the connection.
Test data can be parsed from json format test results and counted to obtain the test scale, success rate, average response time and QPS (Queries per second, query rate per second, is a measure of how much traffic a particular query server handles in a specified time).
Embodiment one may stress test a service node running a software system.
In another embodiment, the method further comprises:
receiving the test results returned by the target clients;
and storing the test result in the distributed system according to the task identifier.
In a specific embodiment, a storage client may be selected from the distributed system, and the test result may be stored with the storage client. And determining the client with the nearest exclusive or distance between the client identifier and the task identifier in the distributed system as a query client. And storing index information consisting of the task identifier and the client identifier of the storage client in the query client.
And acquiring the test result from the determined client.
In another embodiment, the method further comprises:
and adjusting the number of the target clients according to the test report.
In a specific embodiment, when the success rate in the test report is greater than a preset success rate and/or the average response time in the test report is less than a preset response time, which indicates that the service capability (request processing capability) of the service node does not reach the bottleneck, the number of the plurality of target clients is small, and the number of the plurality of target clients can be increased. To obtain the number of clients that can be served when the service capabilities of the service node reach the bottleneck.
In another embodiment, when the success rate in the test report is less than a preset success rate and/or the average response time in the test report is greater than a preset response time, which indicates that the service capability (request processing capability) of the service node reaches the bottleneck, the number of the plurality of target clients is greater, and the number of the plurality of target clients can be reduced.
The number of the plurality of target clients may also be dynamically adjusted according to the QPS in the test report.
Example two
Fig. 2 is a block diagram of a preferred embodiment of a pressure testing apparatus according to an embodiment of the present invention. The stress test device 10 is applied to a computer device in a distributed system and is used for performing stress test on a service node running a software system.
As shown in fig. 2, the pressure testing apparatus 10 may include: a creation unit 201, a selection unit 202, a transmission unit 203, and an acquisition unit 204.
A creating unit 201, configured to create a stress test task, where the stress test task includes a task identifier, a plurality of client identifiers, a test scale, address information of the service node, and a test content.
In a specific embodiment, the creating the stress test task includes:
Acquiring the plurality of client identifiers stored by the computer device;
receiving the input test scale, the test content and the address information of the service node;
encrypting the test scale, the test content and/or the address information to obtain the task identifier;
and combining the task identifier, the plurality of client identifiers, the test scale, the address information of the service node and the test content to obtain the pressure test task.
The plurality of client identities may be IDs, IP (Internet Protocol ) addresses and/or MAC (Media Access Control ) addresses of a plurality of computer terminals or mobile phone terminals, etc.
The test scale may include the number of clients and/or the duration of the test, etc.
The test content may include a character string (the plurality of client terminals may test the service node according to a local interface request corresponding to the character string) or an interface request. The interface request may be a create transaction request and/or a payment request to a linux server running an e-commerce software system; the interface request can be a video download request and/or a video online watching request of a linux server running a video software system; the interface request may also be a login request and/or a reward request to a linux server running a live software system.
The address information may be an IP address, port and/or MAC address of the serving node, etc. The service node may be a linux server.
The encryption algorithm that encrypts the test scale, the test content and/or the address information may be SHA256, SHA384 or SHA512, etc. A target character string composed of the test scale, the test content and/or the address information can be acquired; and encrypting the target character string by adopting an SHA256 algorithm to obtain a hash value of the target character string.
The task identity, the plurality of client identities, the test scale, the address information of the service node and the test content may be combined in key-value form or XML form to obtain the stress test task.
And the selecting unit 202 is configured to select, according to the stress test task, a plurality of target clients that execute the stress test task from a plurality of clients that are located in the distributed system.
In a specific embodiment, the selecting, according to the pressure test task, a plurality of target clients for executing the pressure test task from a plurality of clients located in the distributed system includes:
acquiring a preset identification value range;
And selecting a client with the client identifier contained in the preset identifier value range from the plurality of clients as the target client.
For example, the client identifier may be a 16-ary 4-bit character string, and the preset identifier value range may be 0000-000f; the client identifiers of the three clients are 0001, 000a and 00c6 respectively, and the clients with the client identifiers of 0001 and 000a are selected as a plurality of target clients, wherein the preset identifier value range 0000-000f comprises 0001 and 000a.
For another example, the client identifier may be a 16-ary 64-bit string, and the preset identifier value range may be the 63 rd and 64 th value ranges of the client identifier: 00-0f; the client identifiers of the three clients are fa, 9a and 06 respectively, the client with the client identifier of 06 is selected as a target client, and the preset identifier value range 00-0f comprises 06.
In another embodiment, the selecting, according to the stress test task, a plurality of target clients for executing the stress test task from a plurality of clients located in the distributed system includes:
acquiring a preset identification value range;
selecting a client with the client identifier contained in the preset identifier value range from the plurality of clients to determine the client as a plurality of intermediate clients;
Adjusting the preset identification value range according to the number of the plurality of intermediate clients and the test scale;
and selecting the client with the client identifier contained in the adjusted identifier value range as the target client.
For example, the client identifier may be a 16-ary 64-bit string, and the preset identifier value range may be the 63 rd and 64 th value ranges of the client identifier: 00-0f; selecting 100 intermediate clients from the plurality of clients; the number of clients in the test scale is 50, the number of intermediate clients is larger than the number of clients in the test scale, the preset identification value range is reduced, the number of intermediate clients is close to the number of clients in the test scale, and the adjusted identification value range is obtained; and selecting the client with the client identifier contained in the adjusted identifier value range from the plurality of clients as a plurality of target clients.
And the sending unit 203 is configured to send the pressure test task to the multiple target clients, so that the multiple target clients send test requests to the service node according to the address information and the test content, and the multiple target clients store test results in the distributed system according to the task identifier.
The stress test tasks may be sent to the plurality of target clients by get or post methods. The target clients can generate test requests according to the test contents and send the test requests to the service node according to the address information. And the service node returns processing results to the target clients in response to the test request. And the plurality of target clients receive the processing results, generate test results and store the test results in a distributed system.
The test results may include response time, task processing time consumption, whether the test was successful, etc. The test results may be in json format.
And the obtaining unit 204 is configured to obtain the test result from the distributed system according to the task identifier, and generate a test report.
In a specific embodiment, the obtaining the test result from the distributed system according to the task identifier includes:
determining a client storing the test result from the distributed system according to the task identifier;
and acquiring the test result from the determined client.
Each client in the distributed system has a client identification code, which can be obtained by performing hash calculation on the IP address and/or the MAC address of the client. The hash calculation method of the client identification code may be the same as the hash calculation method of the task identification. Routing information of the plurality of clients may be included in a routing table of the computer apparatus.
An exclusive or distance between the task identification and client identification codes of a plurality of clients in a routing table of the computer device can be calculated; selecting a plurality of clients with small exclusive or distances from the task identification code from a routing table of the computer device as query clients, and iteratively querying the query clients for index information of the task identification code until the index information of the task identification code is received, wherein the index information of the task identification code comprises the task identification code (i.e. key keys in key-value key value pairs) and routing information (i.e. value values in key-value key value pairs) of the clients storing the test results; and determining the client which stores the test result according to the routing information. The determined client may be connected via a TCP (Transmission Control Protocol ) or UDP (User Datagram Protocol, user datagram protocol) protocol. The test results may be obtained from the determined clients through the connection.
Test data can be parsed from json format test results and counted to obtain the test scale, success rate, average response time and QPS (Queries per second, query rate per second, is a measure of how much traffic a particular query server handles in a specified time).
The stress test device 10 of the second embodiment can perform stress test on a service node running a software system.
In another embodiment, the pressure testing device 10 may further include a storage unit, configured to receive the test results returned by the plurality of target clients;
and storing the test result in the distributed system according to the task identifier.
In a specific embodiment, a storage client may be selected from the distributed system, and the test result may be stored with the storage client. And determining the client with the nearest exclusive or distance between the client identifier and the task identifier in the distributed system as a query client. And storing index information consisting of the task identifier and the client identifier of the storage client in the query client.
And acquiring the test result from the determined client.
In another embodiment, the pressure testing apparatus 10 may further include an adjusting unit for adjusting the number of the plurality of target clients according to the test report.
In a specific embodiment, when the success rate in the test report is greater than a preset success rate and/or the average response time in the test report is less than a preset response time, which indicates that the service capability (request processing capability) of the service node does not reach the bottleneck, the number of the plurality of target clients is small, and the number of the plurality of target clients can be increased. To obtain the number of clients that can be served when the service capabilities of the service node reach the bottleneck.
In another embodiment, when the success rate in the test report is less than a preset success rate and/or the average response time in the test report is greater than a preset response time, which indicates that the service capability (request processing capability) of the service node reaches the bottleneck, the number of the plurality of target clients is greater, and the number of the plurality of target clients can be reduced.
The number of the plurality of target clients may also be dynamically adjusted according to the QPS in the test report.
Example III
The present embodiment provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps of the above-described pressure test method embodiment, such as 101-104 shown in fig. 1:
101, creating a stress test task, wherein the stress test task comprises a task identifier, a plurality of client identifiers, a test scale, address information of a service node and test contents;
102, selecting a plurality of target clients for executing the pressure test task from a plurality of clients in a distributed system according to the pressure test task;
103, sending the pressure test task to the target clients, enabling the target clients to send test requests to the service node according to the address information and the test content, and enabling the target clients to store test results in the distributed system according to the task identification;
104, obtaining the test result from the distributed system according to the task identifier, and generating a test report.
Alternatively, the computer program, when executed by a processor, performs the functions of the modules/units in the above-described apparatus embodiments, e.g., units 201-204 in fig. 2:
a creating unit 201, configured to create a stress test task, where the stress test task includes a task identifier, a plurality of client identifiers, a test scale, address information of a service node, and a test content;
a selecting unit 202, configured to select, according to the pressure test task, a plurality of target clients that execute the pressure test task from a plurality of clients that are located in a distributed system;
a sending unit 203, configured to send the pressure test task to the plurality of target clients, so that the plurality of target clients send a test request to the service node according to the address information and the test content, and the plurality of target clients store a test result in the distributed system according to the task identifier;
and the obtaining unit 204 is configured to obtain the test result from the distributed system according to the task identifier, and generate a test report.
Example IV
Fig. 3 is a schematic diagram of a computer device according to an embodiment of the invention. The computer device 1 comprises a memory 20, a processor 30, a bus 50 and a computer program 40 stored in the memory 20 and executable on the processor 30. The steps in the above-described embodiments of the pressure testing method are implemented by the processor 30 when executing the computer program 40, such as 101-104 shown in fig. 1:
101, creating a stress test task, wherein the stress test task comprises a task identifier, a plurality of client identifiers, a test scale, address information of a service node and test contents;
102, selecting a plurality of target clients for executing the pressure test task from a plurality of clients in a distributed system according to the pressure test task;
103, sending the pressure test task to the target clients, enabling the target clients to send test requests to the service node according to the address information and the test content, and enabling the target clients to store test results in the distributed system according to the task identification;
104, obtaining the test result from the distributed system according to the task identifier, and generating a test report.
Alternatively, the processor 30, when executing the computer program 40, performs the functions of the modules/units of the above-described apparatus embodiments, e.g., the units 201-204 in fig. 2:
a creating unit 201, configured to create a stress test task, where the stress test task includes a task identifier, a plurality of client identifiers, a test scale, address information of a service node, and a test content;
a selecting unit 202, configured to select, according to the pressure test task, a plurality of target clients that execute the pressure test task from a plurality of clients that are located in a distributed system;
a sending unit 203, configured to send the pressure test task to the plurality of target clients, so that the plurality of target clients send a test request to the service node according to the address information and the test content, and the plurality of target clients store a test result in the distributed system according to the task identifier;
and the obtaining unit 204 is configured to obtain the test result from the distributed system according to the task identifier, and generate a test report.
Illustratively, the computer program 40 may be partitioned into one or more modules/units that are stored in the memory 20 and executed by the processor 30 to complete the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments are used for describing the execution of the computer program 40 in the computer device 1. For example, the computer program 40 may be divided into a creation unit 201, a selection unit 202, a transmission unit 203, an acquisition unit 204 in fig. 2, each unit having a specific function, see embodiment two.
The computer device 1 may be a PC (Personal Computer ), or may be a terminal device such as a smart phone, a tablet computer, a palm computer, a portable computer, an intelligent router, a mining machine, or a network storage device. In this embodiment, the computer apparatus 1 may be an edge server.
The processor 30 may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor 30 may be any conventional processor or the like, the processor 30 being the control center of the computer device 1, the various interfaces and lines being used to connect the various parts of the overall computer device 1.
The memory 20 may be used to store the computer program 40 and/or modules/units, and the processor 30 may perform various functions of the computer device 1 by executing or executing the computer program and/or modules/units stored in the memory 20, and invoking data stored in the memory 20. The memory 20 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data) created according to the use of the computer device 1, and the like. In addition, the memory 20 may include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), at least one disk storage device, a Flash memory device, or other non-volatile solid state storage device.
The bus 50 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, an extended industry standard architecture (extended industry standard architecture, EISA) bus, or the like. The bus 50 may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one thick line is shown in fig. 3, but not only one bus or one type of bus.
Further, the computer apparatus 1 may also comprise a network interface, which may optionally comprise a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the computer apparatus 1 and other electronic devices.
Optionally, the computer device 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the computer device 1 and for displaying a visual user interface.
It will be appreciated by those skilled in the art that the schematic diagram 3 is merely an example of the computer apparatus 1 and does not constitute a limitation of the computer apparatus 1, and may include more or fewer components than shown, or may combine certain components, or different components.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer arrangement, produces, in whole or in part, a flow or function in accordance with embodiments of the present invention. The computer device may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer apparatus (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
It should be noted that, the foregoing reference numerals of the embodiments of the present invention are merely for describing the embodiments, and do not represent the advantages and disadvantages of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article or method that comprises the element.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (8)

1. A pressure testing method applied to a computer device in a distributed system, the method comprising:
Creating a stress test task, wherein the stress test task comprises a task identifier, a plurality of client identifiers, a test scale, address information of a service node and test contents;
selecting a plurality of target clients for executing the pressure test task from a plurality of clients located in the distributed system according to the pressure test task, wherein the method comprises the following steps: acquiring a preset identification value range; selecting a plurality of intermediate clients with client identifiers contained in the preset identifier value range from the plurality of clients; adjusting the preset identification value range according to the number of the plurality of intermediate clients and the test scale; selecting a client with the client identifier contained in the adjusted identifier value range as the target client;
sending the pressure test task to the target clients, so that the target clients send test requests to the service node according to the address information and the test content, and the target clients store test results in the distributed system according to the task identification;
acquiring the test result from the distributed system according to the task identifier, and generating a test report, wherein the acquisition of the test result from the distributed system according to the task identifier comprises determining a client storing the test result from the distributed system according to the task identifier, and calculating the exclusive or distance between the task identifier and the client identifier of each client; determining a query client from the plurality of clients based on the exclusive or distance; iteratively inquiring the index information of the task identifier to the inquiring client until the index information of the task identifier is received; determining a client storing the test result according to the index information; and acquiring the test result from the client storing the test result.
2. The method of claim 1, wherein creating a stress test task comprises:
acquiring the plurality of client identifiers stored by the computer device;
receiving the input test scale, test content and address information;
encrypting the test scale, the test content and/or the address information to obtain the task identifier;
and combining the task identifier, the plurality of client identifiers, the test scale, the address information of the service node and the test content to obtain the stress test task.
3. The method of claim 1, wherein selecting, from among a plurality of clients located in the distributed system, a plurality of target clients that perform the stress test task according to the stress test task comprises:
acquiring a preset identification value range;
and selecting a client with the client identifier contained in the preset identifier value range from the plurality of clients as the target client.
4. A method according to any one of claims 1-3, wherein the method further comprises:
receiving the test results returned by the target clients;
And storing the test result in the distributed system according to the task identifier.
5. A method according to any one of claims 1-3, wherein the method further comprises:
and adjusting the number of the target clients according to the test report.
6. A computer device, characterized in that it comprises a memory and a processor, on which a computer program is stored which is executable on the processor, which computer program, when being executed by the processor, implements the pressure testing method according to any of claims 1-5.
7. A pressure testing device, the device comprising:
the system comprises a creation unit, a test unit and a test unit, wherein the creation unit is used for creating a stress test task, and the stress test task comprises a task identifier, a plurality of client identifiers, a test scale, address information of a service node and test contents;
the selecting unit is used for selecting a plurality of target clients for executing the pressure test task from a plurality of clients located in the distributed system according to the pressure test task, and comprises the following steps: acquiring a preset identification value range; selecting a plurality of intermediate clients with client identifiers contained in the preset identifier value range from the plurality of clients; adjusting the preset identification value range according to the number of the plurality of intermediate clients and the test scale; selecting a client with the client identifier contained in the adjusted identifier value range as the target client;
The sending unit is used for sending the pressure test task to the target clients, so that the target clients send test requests to the service node according to the address information and the test content, and the target clients store test results in the distributed system according to the task identification;
the acquisition unit is used for acquiring the test result from the distributed system according to the task identifier and generating a test report, wherein the acquisition of the test result from the distributed system according to the task identifier comprises the steps of determining a client which stores the test result from the distributed system according to the task identifier, and calculating the exclusive-or distance between the task identifier and the client identifier of each client; determining a query client from the plurality of clients based on the exclusive or distance; iteratively inquiring the index information of the task identifier to the inquiring client until the index information of the task identifier is received; determining a client storing the test result according to the index information; and acquiring the test result from the client storing the test result.
8. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the pressure testing method according to any of claims 1-5.
CN202010131536.2A 2020-02-28 2020-02-28 Pressure testing method and device, computer device and storage medium Active CN111343048B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010131536.2A CN111343048B (en) 2020-02-28 2020-02-28 Pressure testing method and device, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010131536.2A CN111343048B (en) 2020-02-28 2020-02-28 Pressure testing method and device, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN111343048A CN111343048A (en) 2020-06-26
CN111343048B true CN111343048B (en) 2024-04-09

Family

ID=71187193

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010131536.2A Active CN111343048B (en) 2020-02-28 2020-02-28 Pressure testing method and device, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN111343048B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111913884A (en) * 2020-07-30 2020-11-10 百度在线网络技术(北京)有限公司 Distributed test method, device, equipment, system and readable storage medium
CN111741032B (en) * 2020-08-26 2021-02-26 杭州数列网络科技有限责任公司 Data transmission control method
CN112866062B (en) * 2021-01-29 2023-02-03 北京奇艺世纪科技有限公司 Distributed pressure test system, method, device, equipment and storage medium
CN113037594B (en) * 2021-03-24 2022-09-16 北京百度网讯科技有限公司 Pressure testing method and device based on cloud service
CN114265729B (en) * 2021-11-09 2023-03-28 北京云宽志业网络技术有限公司 Pressure testing method and device, storage medium and electronic equipment
CN114465927B (en) * 2022-04-12 2022-08-02 鹏城实验室 DNS server pressure testing method, electronic equipment and readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101365204A (en) * 2007-08-10 2009-02-11 中兴通讯股份有限公司 Distributed wireless data measurement system based on remote server and measurement method thereof
CN103248535A (en) * 2013-04-28 2013-08-14 华为技术有限公司 Cloud system testing method and device
CN107466065A (en) * 2017-09-06 2017-12-12 ***通信集团江苏有限公司 Determination method, apparatus, equipment and the medium of network quality
CN108347360A (en) * 2018-02-07 2018-07-31 网宿科技股份有限公司 The acquisition method and network server of network testing data
CN110175110A (en) * 2019-05-31 2019-08-27 深圳前海微众银行股份有限公司 Method for testing pressure, device, system, equipment and computer readable storage medium
CN110457203A (en) * 2019-07-04 2019-11-15 深圳壹账通智能科技有限公司 Crawler service test method, device, computer equipment and storage medium
CN110489339A (en) * 2019-07-26 2019-11-22 北京字节跳动网络技术有限公司 Client's side pressure observes and predicts table generating method, system, medium and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2266329A4 (en) * 2008-04-07 2012-03-28 Wavemarket Inc D B A Location Labs Efficient collection of wireless transmitter characteristics

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101365204A (en) * 2007-08-10 2009-02-11 中兴通讯股份有限公司 Distributed wireless data measurement system based on remote server and measurement method thereof
CN103248535A (en) * 2013-04-28 2013-08-14 华为技术有限公司 Cloud system testing method and device
CN107466065A (en) * 2017-09-06 2017-12-12 ***通信集团江苏有限公司 Determination method, apparatus, equipment and the medium of network quality
CN108347360A (en) * 2018-02-07 2018-07-31 网宿科技股份有限公司 The acquisition method and network server of network testing data
CN110175110A (en) * 2019-05-31 2019-08-27 深圳前海微众银行股份有限公司 Method for testing pressure, device, system, equipment and computer readable storage medium
CN110457203A (en) * 2019-07-04 2019-11-15 深圳壹账通智能科技有限公司 Crawler service test method, device, computer equipment and storage medium
CN110489339A (en) * 2019-07-26 2019-11-22 北京字节跳动网络技术有限公司 Client's side pressure observes and predicts table generating method, system, medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘新生.《软件测试理论》.北京:中国计量出版社,第136-137页. *

Also Published As

Publication number Publication date
CN111343048A (en) 2020-06-26

Similar Documents

Publication Publication Date Title
CN111343048B (en) Pressure testing method and device, computer device and storage medium
CN106716404B (en) Proxy server in computer subnet
CN105282126B (en) Login authentication method, terminal and server
US10652227B2 (en) Impersonating target account via account redirection
US20150264095A1 (en) Web service push method and web service push server and web service providing server performing same
RU2631769C2 (en) Method and device for determining objective of information processing
US20170289243A1 (en) Domain name resolution method and electronic device
CN109995876B (en) File transmission method, device, system and computer storage medium
CN104618388B (en) Fast registration login method and corresponding resetting server, information server
CN110297995B (en) Method and device for collecting information
US10652344B2 (en) Method for privacy protection
US20200220937A1 (en) Systems and methods for automated session identifier propagation
CN110808974A (en) Data acquisition method and device, computer device and storage medium
CN112836148A (en) Report display method and device, storage medium and electronic equipment
US20150326577A1 (en) Accelerated application authentication and content delivery
CN111385360A (en) Terminal equipment identification method and device and computer readable storage medium
CN105512516A (en) Expression uploading method and device
CN106533891A (en) Information processing method based on groups and device
CN111752885B (en) Method and device for processing reading authority in reading material
WO2015006903A1 (en) Data processing system, center apparatus and program
CN113961600A (en) Data query method and device, computer equipment and storage medium
CN113434541A (en) Method and device for sending query result, storage medium and electronic device
AU2018324403B2 (en) Monitoring for co-located containers in a host system
CN112231566A (en) Information pushing method, device and system and readable storage medium
CN110266802A (en) Reverse proxy method of servicing, server, system and medium based on ID identification

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
GR01 Patent grant
GR01 Patent grant