CN112052163B - High concurrency webpage pressure testing method and device, electronic equipment and storage medium - Google Patents
High concurrency webpage pressure testing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN112052163B CN112052163B CN202010836779.6A CN202010836779A CN112052163B CN 112052163 B CN112052163 B CN 112052163B CN 202010836779 A CN202010836779 A CN 202010836779A CN 112052163 B CN112052163 B CN 112052163B
- Authority
- CN
- China
- Prior art keywords
- tested
- webpage
- thread
- test
- threads
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 130
- 230000004044 response Effects 0.000 claims abstract description 79
- 238000000034 method Methods 0.000 claims abstract description 48
- 238000009662 stress testing Methods 0.000 claims description 6
- 238000005516 engineering process Methods 0.000 abstract description 5
- 230000009471 action Effects 0.000 description 4
- 230000008901 benefit Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 238000010998 test method Methods 0.000 description 3
- 230000000007 visual effect Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000006378 damage Effects 0.000 description 2
- BUGBHKTXTAQXES-UHFFFAOYSA-N Selenium Chemical compound [Se] BUGBHKTXTAQXES-UHFFFAOYSA-N 0.000 description 1
- 235000014510 cooky Nutrition 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 229910052711 selenium Inorganic materials 0.000 description 1
- 239000011669 selenium Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
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)
- Debugging And Monitoring (AREA)
Abstract
The disclosure relates to a high concurrency webpage pressure testing method, a device, an electronic device and a storage medium, wherein the method comprises the following steps: utilizing a plurality of threads in a thread pool to access the webpage to be tested simultaneously; obtaining a response result of each thread for accessing the webpage to be tested; and determining a pressure test result of the webpage to be tested based on the response result of each thread to access the webpage to be tested. The technical scheme of the embodiment of the disclosure uses the thread pool technology, ensures that concurrent resource utilization is controlled to the minimum, and threads in the thread pool can wait mutually, thereby ensuring that concurrent operation can be started at the same time. In addition, at any moment, the number of threads in the thread pool for carrying out the webpage concurrency test is large, the condition that a large number of testers access the webpage simultaneously can be fully simulated, and the reliability of the test result of the webpage concurrency test can be improved.
Description
Technical Field
The disclosure relates to the technical field of web page testing, in particular to a high-concurrency web page pressure testing method, device, electronic equipment and storage medium.
Background
With the continuous development of internet technology, browsing web pages has been an important way for people to obtain information. Software products based on the B/S architecture are therefore also endless.
Most web page automation test frameworks (e.g., selenium, watin, etc.) focus on testing page elements, and cannot realize high concurrency stress testing of web pages. Therefore, when testing the web page pressure, a method is generally adopted, in which a plurality of testers access the web page to be tested at the same time. However, in practice, the number of the testers is limited, and the condition that a large number of testers access the web page at the same time cannot be met, so that the reliability of the test result of the web page concurrent test is poor, and even the test result of the web page concurrent test cannot reflect the actual situation.
Disclosure of Invention
In order to solve the technical problems described above or at least partially solve the technical problems described above, the present disclosure provides a method, an apparatus, an electronic device, and a storage medium for testing high-concurrency web page pressure.
In a first aspect, the present disclosure provides a method for testing high concurrency web page pressure, including:
utilizing a plurality of threads in a thread pool to access the webpage to be tested simultaneously;
obtaining a response result of each thread for accessing the webpage to be tested;
and determining a pressure test result of the webpage to be tested based on the response result of each thread to access the webpage to be tested.
Further, the concurrently accessing the webpage to be tested by using a plurality of threads in the thread pool includes:
acquiring a test access request;
based on the test access request, determining partial threads in the thread pool as test threads;
after all the test threads in the thread pool are ready, each test thread simultaneously accesses the webpage to be tested.
Further, the response result includes a single response time;
the determining the pressure test result of the webpage to be tested based on the response result of each thread accessing the webpage to be tested comprises the following steps:
determining a comprehensive response result based on the response result of each thread accessing the webpage to be tested, wherein the comprehensive response result comprises at least one of the longest response time, the shortest response time and the average response time;
and determining a pressure test result of the webpage to be tested based on the comprehensive response result.
Further, the concurrently accessing the webpage to be tested by using a plurality of threads in the thread pool includes:
and if the webpage to be tested can be reached, a plurality of threads in the thread pool are utilized to access the webpage to be tested simultaneously.
Further, if the web page to be tested is reachable, before the web page to be tested is accessed concurrently by using the multiple threads in the thread pool, the method further includes:
receiving the URL of the webpage to be tested by using an HttpWebRequest interface of a net framework;
and judging whether the webpage to be tested can be reached or not based on the URL of the webpage to be tested.
Further, after the obtaining the response result of each thread to access the webpage to be tested, the method includes:
judging whether to exit the test;
if the test is not exited, the memory resources corresponding to the thread pool are not recovered, and the steps of concurrently accessing the webpage to be tested by using a plurality of threads in the thread pool and obtaining the response result of each thread accessing the webpage to be tested are repeatedly executed.
Further, after determining the stress test result of the webpage to be tested based on the response result of each thread to access the webpage to be tested, the method further includes:
and displaying the response result of each thread to access the webpage to be tested and/or the pressure test result of the webpage to be tested.
In a second aspect, the present disclosure further provides a high concurrency web page pressure testing apparatus, including:
the access module is used for concurrently accessing the webpage to be tested by utilizing a plurality of threads in the thread pool;
the response result acquisition module is used for acquiring a response result of each thread accessing the webpage to be tested;
the test result determining module is used for determining the pressure test result of the webpage to be tested based on the response result of each thread to access the webpage to be tested.
In a third aspect, the present disclosure also provides an electronic device, including: a processor and a memory;
the processor is operable to perform the steps of any of the methods described above by invoking a program or instruction stored in the memory.
In a fourth aspect, the present disclosure also provides a computer-readable storage medium storing a program or instructions that cause a computer to perform the steps of any of the methods described above.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
the technical scheme of the embodiment of the disclosure uses the thread pool technology, ensures that concurrent resource utilization is controlled to the minimum, and threads in the thread pool can wait mutually, thereby ensuring that concurrent operation can be started at the same time. In addition, at any moment, the number of threads in the thread pool for carrying out the webpage concurrency test is large, the condition that a large number of testers access the webpage simultaneously can be fully simulated, and the reliability of the test result of the webpage concurrency test can be improved.
The technical scheme of the embodiment of the disclosure uses a native web interface provided by a net framework, so that the hardware performance is not consumed by a redundant function during concurrent operation.
The technical scheme of the embodiment of the disclosure provides the visual interface for the testers to observe the test result, and can improve the user experience.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flowchart of a method for testing high concurrency web page pressure according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of another method for high concurrency web page stress testing provided by embodiments of the present disclosure;
FIG. 3 is a block diagram of an apparatus for implementing the high concurrency web page stress testing method of FIG. 2;
fig. 4 is a block diagram of a high concurrency web page pressure testing device according to an embodiment of the disclosure;
fig. 5 is a schematic hardware structure of an electronic device according to an embodiment of the disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
Fig. 1 is a flowchart of a method for testing high concurrency web page pressure according to an embodiment of the present disclosure. The execution subject of the high concurrency webpage pressure testing method can be a user terminal or a server and the like. The high concurrency webpage pressure testing method comprises the following steps:
s110, a plurality of threads in the thread pool are utilized to access the webpage to be tested concurrently.
Thread pools can be understood as a pattern of thread usage. Creating/destroying threads with overhead and too frequent creating/destroying threads can greatly affect processing efficiency and further affect cache locality and overall performance. While the thread pool maintains multiple threads waiting for the supervisory manager to allocate tasks that can be concurrently executed. This avoids the cost of creating and destroying threads while processing short-time tasks. The thread pool not only can ensure full utilization of the kernel, but also can prevent excessive scheduling.
The implementation method of this step is various, and illustratively, the implementation method of this step may include: acquiring a test access request; based on the test access request, determining partial threads in the thread pool as test threads; after all the test threads in the thread pool are ready, each test thread accesses the webpage to be tested simultaneously.
Wherein the test access request should include the necessary information to access the web page to be tested, such as the test access request includes the URL (Uniform Resource Locator ) of the web page to be tested; or the test access request comprises the URL of the webpage to be tested and a request head; alternatively, the test access request includes the URL of the web page to be tested, the request header, and the cookie.
S120, obtaining response results of each thread to access the webpage to be tested.
The response results may be various, such as a single response time of the test web page for each thread.
S130, determining a pressure test result of the webpage to be tested based on the response result of each thread to access the webpage to be tested.
The specific implementation method of the step is various, and if the response result comprises single response time by way of example; the specific implementation method of the step can comprise the following steps: determining a comprehensive response result based on the response results of each thread accessing the webpage to be tested, wherein the comprehensive response result comprises at least one of the longest response time, the shortest response time and the average response time; and determining a pressure test result of the webpage to be tested based on the comprehensive response result.
The benefit of a thread pool is that it saves system resources consumed in creating threads as opposed to constantly created threads. In practice, the upper limit of threads in a thread pool may be specified as desired. Illustratively, the thread pool upper limit may be set to 32767. It should be noted that, theoretically, the more CPU cores/threads, the larger the thread pool upper limit that the thread pool can set. For unused threads, the thread pool only hangs it without destruction for subsequent use. The thread pool is suitable for concurrent operation with simple logic and short operation time. The logic for accessing the test web page is not complex and the single execution time is very short, which is suitable for using thread pool technology.
The essence of the technical scheme is that the thread pool is beneficial to simulating a high concurrency scene that a plurality of people access the webpage to be tested simultaneously so as to realize high concurrency webpage pressure test, and as the upper limit of threads in the thread pool is very large in practice, the situation that a plurality of users access the test webpage simultaneously can be fully simulated, and the reliability of the obtained high concurrency webpage pressure test result can be ensured. In addition, by using the thread pool, system resources consumed by the creation/destruction of threads can be reduced.
It should be noted that, without considering other scheduling time, N threads are theoretically executed N times faster than N times of single thread loop execution, i.e. the degree of efficiency improvement depends on how many threads are. In practical situations, however, the time consumed by the thread pool call is considered, and the use of threads in the threads may be reduced when the load of the CPU carrying N threads is considered to be large.
Optionally, based on the above technical solutions, S110 may be replaced by: and if the webpage to be tested can be reached, a plurality of threads in the thread pool are utilized to access the webpage to be tested simultaneously. The essence of the setting is that before the concurrent webpage pressure test is carried out on the webpage to be tested, whether the webpage to be tested can be normally accessed is judged. The normal access may be understood as that when the web page to be tested is accessed, the return flow of the web page to be tested is appropriate, or the web page to be tested returns a preset code. Since concurrent web page stress testing is meaningless for web pages to be tested if they are not reachable. By the arrangement, concurrent access pressure test can be conducted only under the condition that the webpage to be tested can be normally accessed, and unnecessary test consumption of system resources can be avoided.
Based on the above technical solution, optionally, if the web page to be tested is reachable, before the web page to be tested is accessed concurrently by using multiple threads in the thread pool, the method further includes: receiving the URL of the webpage to be tested by using an HttpWebRequest interface of the net framework; and judging whether the webpage to be tested can be reached or not based on the URL of the webpage to be tested. Because the web page request uses the self-contained Windows system, the netlibrary interface HttpWebRequest is a simple web page access method package, has no redundant function, and saves the system resource consumption during test.
On the basis of the above technical solutions, optionally, after S120, the method includes: judging whether to exit the test; if the test is not to be exited, the memory resources corresponding to the thread pool are not recovered, and step S110 and step S120 are repeatedly executed. The purpose of this is to enter a loop test mode without exiting the test. The significance of the setting is to simulate the thinking condition of the user and test the long-time compressive capacity of the webpage to be tested. Alternatively, the time interval between two adjacent tests may be set. Alternatively, in practice, the execution of the thread pool may be controlled by the host process to be suspended while resources are added to the thread pool. After one execution, it may be selected whether to continue execution. If the execution is continued, the system memory resource is not released, the prepared test thread is suspended, the standby state is entered, and when all the test threads are prepared, concurrent access is performed again, so that the execution synchronism is ensured. And if the execution is not continued, releasing the system memory resources. In addition, in the scheme, if the execution is continued, the system memory resources are not released, and the time spent by the thread for occupying the memory resources can be reduced.
In practice, when performing the loop test, the number of test threads used for each test may be the same or different. In practice, it may be determined according to the running condition of the device currently performing the concurrent test.
On the basis of the above technical solutions, optionally, after S130, the method further includes: and displaying the response result of each thread to access the webpage to be tested and/or the pressure test result of the webpage to be tested. By the arrangement, a user can intuitively know the pressure test result, follow-up operation is facilitated, and user experience is improved.
Fig. 2 is a flowchart of another method for testing high concurrency web page pressure provided by an embodiment of the present disclosure. Fig. 2 is a specific example of fig. 1. Fig. 3 is a block diagram of an apparatus for implementing the high concurrency web page stress test method of fig. 2. Referring to fig. 2 and 3, the high concurrency web page pressure testing method includes:
firstly, the pre-access testing module receives the URL and the request header of the webpage to be tested by using the HttpWebRequest interface, accesses the webpage to be tested by bypassing the certificate, checks the accessibility of the webpage to be tested, and whether the data (such as a preset code) is correctly returned. And retaining parameter data (such as necessary information for accessing the webpage to be tested, such as URL of the webpage to be tested), and transmitting the data to the stress test module after the data pass verification.
Secondly, the pressure test module receives parameter data (such as necessary information for accessing a webpage to be tested, such as a URL of the webpage to be tested) transmitted by the pre-access test module, and transmits the parameter data to the high concurrency execution module to prepare concurrency access, and whether the cycle access is performed is known to determine whether to call the cycle execution module.
Again, the high concurrency execution module uses the ThreadPool interface to generate a large number of access requests to join the thread pool and uses the delegation method specific to the net framework to have all threads wait for events ready to complete. And after all the effective threads in the thread pool are ready to be completed, simultaneously sending out a request to achieve the effect of accessing a large amount of web pages instantaneously.
Again, if the loop execution module is enabled, the last concurrently accessed resource will not be released and the request will continue to be regenerated within the respective thread pool. The delegation method adds a delay event on the basis of the original method and simulates the short thinking action of the client.
And finally, recording response results, such as single response time, longest shortest response time and average response time information, by the recording module when each thread sends out a request. And the information is displayed in a window visual window, so that the tester can observe and record conveniently.
The technical scheme has the following advantages:
the technical scheme ensures that concurrent resource utilization is controlled to the minimum by using the thread pool technology, threads in the thread pool can wait mutually, and concurrent operation can be started at the same time. In addition, at any moment, the number of threads in the thread pool for carrying out the webpage concurrency test is large, the condition that a large number of testers access the webpage simultaneously can be fully simulated, and the reliability of the test result of the webpage concurrency test can be improved.
The technical scheme uses the native web interface provided by the net framework, so that the hardware performance is not consumed by the redundant function during concurrent operation.
The technical scheme provides the visual interface for the testers to observe the test results, so that the user experience can be improved.
The embodiment of the disclosure also provides a high concurrency webpage pressure testing device. Fig. 4 is a block diagram of a high concurrency web page pressure testing device according to an embodiment of the disclosure. Referring to fig. 4, the high concurrency web page pressure testing apparatus includes:
an access module 310, configured to concurrently access the webpage to be tested by using multiple threads in the thread pool;
a response result obtaining module 320, configured to obtain a response result of each thread accessing the webpage to be tested;
the test result determining module 330 is configured to determine a stress test result of the web page to be tested based on a response result of each thread accessing the web page to be tested.
Further, the access module 310 is specifically configured to:
acquiring a test access request;
based on the test access request, determining partial threads in the thread pool as test threads;
after all the test threads in the thread pool are ready, each test thread simultaneously accesses the webpage to be tested.
Further, the response result includes a single response time;
the test result determining module 330 is configured to:
determining a comprehensive response result based on the response result of each thread accessing the webpage to be tested, wherein the comprehensive response result comprises at least one of the longest response time, the shortest response time and the average response time;
and determining a pressure test result of the webpage to be tested based on the comprehensive response result.
Further, the access module 310 is specifically configured to:
and if the webpage to be tested can be reached, a plurality of threads in the thread pool are utilized to access the webpage to be tested simultaneously.
Further, the high concurrency webpage pressure testing device also comprises a pre-access module, wherein the pre-access module is used for receiving the URL of the webpage to be tested by using an HttpWebRequest interface of a net framework before the webpage to be tested is accessed by using a plurality of threads in a thread pool in concurrency way if the webpage to be tested can be reached;
and judging whether the webpage to be tested can be reached or not based on the URL of the webpage to be tested.
Further, the high concurrent webpage pressure testing device further comprises a circulation module, wherein the circulation module is used for judging whether to exit the test after the response result of each thread for accessing the webpage to be tested is obtained; if the test is not exited, the memory resources corresponding to the thread pool are not recovered, and the steps of concurrently accessing the webpage to be tested by using a plurality of threads in the thread pool and obtaining the response result of each thread accessing the webpage to be tested are repeatedly executed.
Further, the high concurrent web page pressure testing device further comprises a display module, which is used for displaying the response result of each thread accessing the web page to be tested and/or the pressure testing result of the web page to be tested after determining the pressure testing result of the web page to be tested based on the response result of each thread accessing the web page to be tested.
The device disclosed in the above embodiment can implement the flow of the method disclosed in the above method embodiments, and has the same or corresponding beneficial effects. In order to avoid repetition, the description is omitted here.
Fig. 5 is a schematic hardware structure of an electronic device provided by an embodiment of the present disclosure, where, as shown in fig. 5, the electronic device may be a user terminal or a server, and the electronic device includes:
one or more processors 301, one processor 301 being illustrated in fig. 5;
a memory 302;
the electronic device may further include: an input device 303 and an output device 304.
The processor 301, the memory 302, the input means 303 and the output means 304 in the electronic device may be connected by a bus or by other means, in fig. 5 by way of example.
The memory 302 serves as a non-transitory computer readable storage medium that may be used to store software programs, computer executable programs, and modules, such as program instructions/modules (e.g., the access module 310, the response result acquisition module 320, and the test result determination module 330, shown in fig. 4) corresponding to the high concurrency web page stress test method in the embodiments of the present disclosure. The processor 301 executes various functional applications of the server and data processing by running software programs, instructions and modules stored in the memory 302, i.e. implements the high concurrency web page stress test method of the above method embodiment.
Memory 302 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of the electronic device, etc. In addition, memory 302 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 302 may optionally include memory located remotely from processor 301, which may be connected to the terminal device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 303 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the electronic device. The output device 304 may include a display device such as a display screen.
Embodiments of the present disclosure also provide a computer-readable storage medium storing a program or instructions that when executed by a computer cause the computer to perform a method of high concurrency web page stress testing, the method comprising:
utilizing a plurality of threads in a thread pool to access the webpage to be tested simultaneously;
obtaining a response result of each thread for accessing the webpage to be tested;
and determining a pressure test result of the webpage to be tested based on the response result of each thread to access the webpage to be tested.
Optionally, the computer executable instructions, when executed by the computer processor, may also be used to perform the technical solution of the high concurrency web page pressure testing method provided by any embodiment of the present disclosure.
From the above description of embodiments, it will be apparent to those skilled in the art that the present disclosure may be implemented by means of software and necessary general purpose hardware, but may of course also be implemented by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present disclosure may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk, or an optical disk of a computer, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments of the present disclosure.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (9)
1. A method for testing high concurrency web page pressure, comprising:
utilizing a plurality of threads in a thread pool to access the webpage to be tested simultaneously;
obtaining a response result of each thread for accessing the webpage to be tested;
determining a pressure test result of the webpage to be tested based on the response result of each thread to access the webpage to be tested;
after the response result of each thread accessing the webpage to be tested is obtained, the method comprises the following steps:
judging whether to exit the test;
if the test is not exited, the memory resources corresponding to the thread pool are not recovered, and the steps of concurrently accessing the webpage to be tested by using a plurality of threads in the thread pool and obtaining the response result of each thread accessing the webpage to be tested are repeatedly executed.
2. The method for testing the high concurrency web page pressure according to claim 1, wherein the concurrently accessing the web page to be tested by using a plurality of threads in the thread pool comprises:
acquiring a test access request;
based on the test access request, determining partial threads in the thread pool as test threads;
after all the test threads in the thread pool are ready, each test thread simultaneously accesses the webpage to be tested.
3. The high concurrency web page stress testing method of claim 1, wherein the response results comprise a single response time;
the determining the pressure test result of the webpage to be tested based on the response result of each thread accessing the webpage to be tested comprises the following steps:
determining a comprehensive response result based on the response result of each thread accessing the webpage to be tested, wherein the comprehensive response result comprises at least one of the longest response time, the shortest response time and the average response time;
and determining a pressure test result of the webpage to be tested based on the comprehensive response result.
4. The method for testing the high concurrency web page pressure according to claim 1, wherein the concurrently accessing the web page to be tested by using a plurality of threads in the thread pool comprises:
and if the webpage to be tested can be reached, a plurality of threads in the thread pool are utilized to access the webpage to be tested simultaneously.
5. The method for testing the pressure of the high-concurrency web page according to claim 4, wherein if the web page to be tested is reachable, before the web page to be tested is accessed concurrently by using a plurality of threads in the thread pool, further comprising:
receiving the URL of the webpage to be tested by using an HttpWebRequest interface of a net framework;
and judging whether the webpage to be tested can be reached or not based on the URL of the webpage to be tested.
6. The method for testing the pressure of the web page to be tested according to claim 1, wherein after determining the pressure test result of the web page to be tested based on the response result of each thread to access the web page to be tested, the method further comprises:
and displaying the response result of each thread to access the webpage to be tested and/or the pressure test result of the webpage to be tested.
7. A high concurrency web page pressure testing device, comprising:
the access module is used for concurrently accessing the webpage to be tested by utilizing a plurality of threads in the thread pool;
the response result acquisition module is used for acquiring a response result of each thread accessing the webpage to be tested;
the test result determining module is used for determining a pressure test result of the webpage to be tested based on a response result of each thread accessing the webpage to be tested;
the circulation module is used for judging whether to exit the test after the response result of each thread for accessing the webpage to be tested is obtained; and if the test is not exited, the memory resources corresponding to the thread pool are not recovered, and the access module and the response result acquisition module are repeatedly called.
8. An electronic device, comprising: a processor and a memory;
the processor is adapted to perform the steps of the method according to any of claims 1 to 6 by invoking a program or instruction stored in the memory.
9. A computer readable storage medium storing a program or instructions for causing a computer to perform the steps of the method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010836779.6A CN112052163B (en) | 2020-08-19 | 2020-08-19 | High concurrency webpage pressure testing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010836779.6A CN112052163B (en) | 2020-08-19 | 2020-08-19 | High concurrency webpage pressure testing method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112052163A CN112052163A (en) | 2020-12-08 |
CN112052163B true CN112052163B (en) | 2023-11-10 |
Family
ID=73600408
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010836779.6A Active CN112052163B (en) | 2020-08-19 | 2020-08-19 | High concurrency webpage pressure testing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112052163B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114257529A (en) * | 2021-12-24 | 2022-03-29 | 深圳市欣博跃电子有限公司 | Network equipment stability testing method, device, equipment, system and medium |
CN116132328A (en) * | 2023-02-10 | 2023-05-16 | 北京安锐卓越信息技术股份有限公司 | Network pressure testing method and device, storage medium and electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012118577A (en) * | 2010-11-29 | 2012-06-21 | Ird:Kk | Illegal domain detection device, illegal domain detection method and program |
CN104317938A (en) * | 2014-10-31 | 2015-01-28 | 北京国双科技有限公司 | Webpage validation method and device |
CN106371987A (en) * | 2015-07-24 | 2017-02-01 | 北京奇虎科技有限公司 | Test method and device |
CN108282478A (en) * | 2018-01-23 | 2018-07-13 | 湖南科技学院 | A kind of WEB site safeties detection method, device and computer-readable medium |
CN108572919A (en) * | 2018-05-30 | 2018-09-25 | 平安普惠企业管理有限公司 | Automated testing method, device, computer equipment and storage medium |
CN110058990A (en) * | 2019-03-12 | 2019-07-26 | 平安普惠企业管理有限公司 | Performance test methods and device, computer equipment, storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8799262B2 (en) * | 2011-04-11 | 2014-08-05 | Vistaprint Schweiz Gmbh | Configurable web crawler |
-
2020
- 2020-08-19 CN CN202010836779.6A patent/CN112052163B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012118577A (en) * | 2010-11-29 | 2012-06-21 | Ird:Kk | Illegal domain detection device, illegal domain detection method and program |
CN104317938A (en) * | 2014-10-31 | 2015-01-28 | 北京国双科技有限公司 | Webpage validation method and device |
CN106371987A (en) * | 2015-07-24 | 2017-02-01 | 北京奇虎科技有限公司 | Test method and device |
CN108282478A (en) * | 2018-01-23 | 2018-07-13 | 湖南科技学院 | A kind of WEB site safeties detection method, device and computer-readable medium |
CN108572919A (en) * | 2018-05-30 | 2018-09-25 | 平安普惠企业管理有限公司 | Automated testing method, device, computer equipment and storage medium |
CN110058990A (en) * | 2019-03-12 | 2019-07-26 | 平安普惠企业管理有限公司 | Performance test methods and device, computer equipment, storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112052163A (en) | 2020-12-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Garbers et al. | Finding clusters in VLSI circuits | |
US8863085B1 (en) | Monitoring web applications | |
CN112052163B (en) | High concurrency webpage pressure testing method and device, electronic equipment and storage medium | |
CN107256180B (en) | Data processing method, device and terminal | |
US6567767B1 (en) | Terminal server simulated client performance measurement tool | |
US20120253745A1 (en) | System and method for testing performance of mobile application server | |
CN106649057A (en) | Method and device for testing server pressure | |
US10666758B2 (en) | Browser resource pre-pulling method, terminal and storage medium | |
CN107608901B (en) | Jmeter-based testing method and device, storage medium and electronic equipment | |
WO2016150324A1 (en) | Page module rendering method, apparatus and display device | |
CN109542758B (en) | Method and device for testing fault tolerance of application program and computer readable storage medium | |
CN105630683B (en) | A kind of cloud testing architecture | |
CN102880616A (en) | Browser page loading method and device | |
WO2018054200A1 (en) | Method and device for reading file | |
CN109344066A (en) | A kind of test method of browser page, system and terminal | |
CN113191114B (en) | Method and apparatus for validating a system | |
CN102377799B (en) | Mobile phone browser server end and realize the method for the two thread mode of browser | |
CN110413911A (en) | Network picture loading method, device, terminal device and computer readable storage medium | |
US20140344447A1 (en) | Method and apparatus for executing application | |
CN109828921A (en) | HTML5 webpage automated function test method, system and electronic equipment | |
CN111079048A (en) | Page loading method and device | |
CN110401580A (en) | Webpage status monitoring method and relevant device based on heartbeat mechanism | |
EP3148120A1 (en) | Service system test method and device | |
CN112699040A (en) | Pressure testing method, device, equipment and computer readable storage medium | |
CN107220165A (en) | The method and apparatus of pressure test on a kind of artificial line |
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 |