CN108920346A - Web server interface time-consuming statistical method and device - Google Patents
Web server interface time-consuming statistical method and device Download PDFInfo
- Publication number
- CN108920346A CN108920346A CN201810569370.5A CN201810569370A CN108920346A CN 108920346 A CN108920346 A CN 108920346A CN 201810569370 A CN201810569370 A CN 201810569370A CN 108920346 A CN108920346 A CN 108920346A
- Authority
- CN
- China
- Prior art keywords
- interface
- time
- request
- type
- call
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3409—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
- G06F11/3419—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3452—Performance evaluation by statistical analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Probability & Statistics with Applications (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Debugging And Monitoring (AREA)
Abstract
The present invention provides a kind of web server interface time-consuming statistical method and device, this method include:The interface call request for calling equipment to send target interface is received, and records request time, the interface call request includes interface type and delay call instruction;When determining that the corresponding interface protocol of the target interface is asynchronous execution type according to the interface type, so that the interface protocol is finished according to the delay call instruction, and sent to the calling equipment and call feedback result, records sending time;The interface for obtaining the target interface according to the request time and the sending time is time-consuming, can count the real time-consuming of each interface, effectively to assess the Potential performance bottleneck of current device.
Description
Technical field
The present invention relates to field of communication technology more particularly to a kind of web server interface time-consuming statistical method and devices.
Background technique
When being tested for the property or monitoring to web server interface, need to calculate the short time consumption of interface, and
The Potential performance bottleneck of current background server is assessed by the short time consumption of interface, so calculating the accurate of time-consuming method
Property just seem and be even more important, calculation method is more accurate, and agreement embodies true loading condition.For existing before interface calling
A timestamp to be beaten, postscript timestamp is terminated, the mode that then the two makes the difference optimizes to count time-consuming method, but
When for asynchronous call situation, interface protocol is not carried out completion, and called side can receive a feedback result, and goes to execute next mesh
The calling task of tag splice mouth, since the feedback result non-executing is completed as a result, certainly will will cause the interface time-consuming of statistics at this time not
Accurately.
Summary of the invention
The present invention provides a kind of web server interface time-consuming statistical method and device, is directed in the prior art for solving
The problem of the time-consuming inaccuracy of the interface counted in the case of asynchronous call.
In a first aspect, the embodiment of the present invention provides a kind of web server interface time-consuming statistical method, including:
The interface call request for calling equipment to send target interface is received, and records request time, the interface tune
It include interface type and delay call instruction with request;
When determining that the corresponding interface protocol of the target interface is asynchronous execution type according to the interface type, according to
The delay call instruction makes the interface protocol be finished, and sends to the calling equipment and call feedback result, record
Sending time;
The interface for obtaining the target interface according to the request time and the sending time is time-consuming.
Optionally, further include:
When determining that the corresponding interface protocol of the target interface executes type to synchronize according to the interface type, execute
The interface protocol, and sent to the calling equipment and call feedback result, record sending time.
Optionally, further include:
When determining that the corresponding interface protocol of the target interface is asynchronous execution type according to the interface type, to institute
It states and calls equipment to send feedback request as a result, so that the calling equipment asks the corresponding interface calling of next target interface transmission
It asks.
Optionally, the interface for obtaining the target interface according to the request time and the sending time is time-consuming,
Including:Interval time is obtained according to the request time and the sending time, the interface as the target interface is time-consuming.
Second aspect, a kind of web server interface time-consuming statistic device provided in an embodiment of the present invention, including:
Receiving module calls the interface call request that sends to target interface of equipment for receiving, and when recording request
Between, the interface call request includes interface type and delay call instruction;
Execution module, for determining that the corresponding interface protocol of the target interface is asynchronous holds according to the interface type
When row type, so that the interface protocol is finished according to the delay call instruction, and sends and call to the calling equipment
Feedback result records sending time;
Statistical module, the interface for obtaining the target interface according to the request time and the sending time consume
When.
Optionally, the execution module is also used to:
When determining that the corresponding interface protocol of the target interface executes type to synchronize according to the interface type, execute
The interface protocol, and sent to the calling equipment and call feedback result, record sending time.
Optionally, further include sending module, be used for:
When determining that the corresponding interface protocol of the target interface is asynchronous execution type according to the interface type, to institute
It states and calls equipment to send feedback request as a result, so that the calling equipment asks the corresponding interface calling of next target interface transmission
It asks.
Optionally, the statistical module is specifically used for:When obtaining interval according to the request time and the sending time
Between, the interface as the target interface is time-consuming.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, including:It processor, memory, bus and is stored in
On memory and the computer program that can run on a processor;
Wherein, the processor, memory complete mutual communication by the bus;
The processor realizes such as above-mentioned method when executing the computer program.
Fourth aspect, the embodiment of the present invention provide a kind of non-transient computer readable storage medium, the non-transient calculating
It is stored with computer program on machine readable storage medium storing program for executing, such as above-mentioned method is realized when which is executed by processor.
As shown from the above technical solution, a kind of web server interface time-consuming statistical method provided in an embodiment of the present invention and
Device by receiving the interface type and delay call instruction that call equipment to send target interface, and records request time,
And when determining that the corresponding interface protocol of the target interface is asynchronous execution type according to the interface type, prolonged according to described
Slow call instruction makes the interface protocol be finished, and sends to the calling equipment and call feedback result, when record is sent
Between, thus it is time-consuming according to the interface that the request time and the sending time obtain the target interface, it can effectively count each
The real time-consuming of interface, to assess the Potential performance bottleneck of current device.
Detailed description of the invention
Fig. 1 is the flow diagram for the web server interface time-consuming statistical method that one embodiment of the invention provides;
Fig. 2 is the structural schematic diagram for the web server interface time-consuming statistic device that one embodiment of the invention provides;
Fig. 3 is the structural schematic diagram for the electronic equipment that one embodiment of the invention provides.
Specific embodiment
With reference to the accompanying drawings and examples, specific embodiments of the present invention will be described in further detail.Implement below
Example is not intended to limit the scope of the invention for illustrating the present invention.
Fig. 1 shows one embodiment of the invention and provides a kind of web server interface time-consuming statistical method, including:
S11, the interface call request for calling equipment to send target interface is received, and records request time, it is described to connect
Mouth call request includes interface type and delay call instruction;
S12, according to the interface type determine the corresponding interface protocol of the target interface be asynchronous execution type when,
So that the interface protocol is finished according to the delay call instruction, and sent to the calling equipment and call feedback result,
Record sending time;
S13, the interface that the target interface is obtained according to the request time and the sending time are time-consuming.
For above-mentioned steps S11- step S13, it should be noted that being tested for the property to web server interface or
When person monitors, need to calculate the short time consumption of interface.In web server, the corresponding interface protocol of each interface,
Interface protocol can be called.
In executing interface calling procedure, equipment is called to can determine whether the target interface of called equipment, and called to this
Equipment sends the interface call request to target interface, which may include interface type and delay call instruction.
Due to needing to count the time-consuming of target interface, therefore called equipment will record the request time for receiving interface call request.
In the present embodiment, the interface protocol on interface can be divided into asynchronous call or synchronization call, i.e. interface protocol can divide
For asynchronous execution type and synchronous execution type.
Asynchronous call can be called after equipment receives call request, whether complete not wait for the interface protocol being performed
At just to calling equipment feedback request as a result, so that equipment is called to continue to execute the call request to next target interface.Needle
Asynchronous call can be used:Determining that the corresponding interface protocol of the target interface is asynchronous execution class according to the interface type
When type, feedback request is sent to the calling equipment as a result, so that the calling equipment is corresponding to the transmission of next target interface
Interface call request.
Synchronization call can be called after equipment receives call request, and interface protocol to be performed is waited to complete, then to
It calls equipment to send and calls feedback result, so as to which equipment is called to continue to execute the call request to next target interface.In this hair
In bright embodiment, it can be used for synchronization call:Determining that the corresponding interface of the target interface is assisted according to the interface type
When view executes type to synchronize, the interface protocol is executed, and send to the calling equipment and call feedback result.
In embodiments of the present invention, determining that the corresponding interface protocol of the target interface is different according to the interface type
When step executes type, so that the interface protocol is finished according to the delay call instruction, and is sent to the calling equipment
Feedback result is called, sending time is recorded.I.e. when interface protocol is asynchronous execution type, delay call instruction is obtained, need to be made
The interface protocol is finished, and just sends to the calling equipment and calls feedback result.At this point, called equipment will record hair
Send the sending time for calling feedback result.
Called equipment is time-consuming according to the interface that the request time and the sending time obtain the target interface, i.e.,
Interval time is obtained according to the request time and the sending time, the interface as the target interface is time-consuming.At this point, just
It can solve when interface protocol is asynchronous execution type, acquisition target interface short time consumption can be used as by the time completed is executed
End time.
A kind of web server interface time-consuming statistical method provided in an embodiment of the present invention calls equipment pair by receiving
The interface type and delay call instruction that target interface is sent, and request time is recorded, and determine according to the interface type
When the corresponding interface protocol of the target interface is asynchronous execution type, the interface protocol is made according to the delay call instruction
Be finished, and sent to the calling equipment and call feedback result, record sending time, thus according to the request time and
The interface that the sending time obtains the target interface is time-consuming, can effectively count the real time-consuming of each interface, current to assess
The Potential performance bottleneck of equipment.
Fig. 2 shows a kind of web server interface time-consuming statistic devices that one embodiment of the invention provides, including receive mould
Block 21, execution module 22 and statistical module 23, wherein:
Receiving module 21 for receiving the interface call request for calling equipment to send target interface, and records request
Time, the interface call request include interface type and delay call instruction;
Execution module 22, for determining that the corresponding interface protocol of the target interface is asynchronous according to the interface type
When executing type, so that the interface protocol is finished according to the delay call instruction, and sends and adjust to the calling equipment
With feedback result, sending time is recorded;
Statistical module 23, the interface for obtaining the target interface according to the request time and the sending time consume
When.
Further include sending module, is used for:
When determining that the corresponding interface protocol of the target interface is asynchronous execution type according to the interface type, to institute
It states and calls equipment to send feedback request as a result, so that the calling equipment asks the corresponding interface calling of next target interface transmission
It asks.
Since described device of the embodiment of the present invention is identical as the principle of above-described embodiment the method, for more detailed
Explain that details are not described herein for content.
It should be noted that can be by hardware processor (hardware processor) come real in the embodiment of the present invention
Existing related function module.
A kind of web server interface time-consuming statistic device provided in an embodiment of the present invention calls equipment pair by receiving
The interface type and delay call instruction that target interface is sent, and request time is recorded, and determine according to the interface type
When the corresponding interface protocol of the target interface is asynchronous execution type, the interface protocol is made according to the delay call instruction
Be finished, and sent to the calling equipment and call feedback result, record sending time, thus according to the request time and
The interface that the sending time obtains the target interface is time-consuming, can effectively count the real time-consuming of each interface, current to assess
The Potential performance bottleneck of equipment.
Fig. 3 shows the embodiment of the present invention and provides a kind of electronic equipment, including:Processor 31, memory 32, bus 33 and
Store the computer program that can be run on a memory and on a processor;
Wherein, the processor, memory complete mutual communication by the bus;
The processor realizes such as above-mentioned method when executing the computer program, for example including:Calling is received to set
The standby interface type that target interface is sent and delay call instruction, and request time is recorded, and according to the interface type
When determining that the corresponding interface protocol of the target interface is asynchronous execution type, the interface is made according to the delay call instruction
Agreement is finished, and sends to the calling equipment and call feedback result, sending time is recorded, thus when according to the request
Between and the sending time obtain the target interface interface it is time-consuming.
The embodiment of the present invention provides a kind of non-transient computer readable storage medium, the non-transient computer readable storage
It is stored with computer program on medium, such as above-mentioned method is realized when which is executed by processor, for example including:It connects
The interface type and delay call instruction for calling equipment to send target interface are received, and records request time, and according to institute
State interface type determine the corresponding interface protocol of the target interface be asynchronous execution type when, according to the delay call instruction
So that the interface protocol is finished, and sent to the calling equipment and call feedback result, records sending time, thus according to
The interface that the request time and the sending time obtain the target interface is time-consuming.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention
Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed
Meaning one of can in any combination mode come using.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability
Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real
It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch
To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame
Claim.
Those of ordinary skill in the art will appreciate that:The above embodiments are only used to illustrate the technical solution of the present invention., and
It is non-that it is limited;Although present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art
It should be understood that:It is still possible to modify the technical solutions described in the foregoing embodiments, either to part of or
All technical features are equivalently replaced;And these are modified or replaceed, it does not separate the essence of the corresponding technical solution this hair
Bright claim limited range.
Claims (10)
1. a kind of web server interface time-consuming statistical method, which is characterized in that including:
The interface call request for calling equipment to send target interface is received, and records request time, the interface calling is asked
It asks including interface type and delay call instruction;
When determining that the corresponding interface protocol of the target interface is asynchronous execution type according to the interface type, according to described
Delay call instruction makes the interface protocol be finished, and sends to the calling equipment and call feedback result, and record is sent
Time;
The interface for obtaining the target interface according to the request time and the sending time is time-consuming.
2. the method according to claim 1, wherein further including:
When determining that the corresponding interface protocol of the target interface executes type to synchronize according to the interface type, described in execution
Interface protocol, and sent to the calling equipment and call feedback result, record sending time.
3. the method according to claim 1, wherein further including:
When determining that the corresponding interface protocol of the target interface is asynchronous execution type according to the interface type, to the tune
Feedback request is sent with equipment as a result, so that the calling equipment sends corresponding interface call request to next target interface.
4. the method according to claim 1, wherein described obtain according to the request time and the sending time
The interface for obtaining the target interface is time-consuming, including:Interval time is obtained according to the request time and the sending time, as
The interface of the target interface is time-consuming.
5. a kind of web server interface time-consuming statistic device, which is characterized in that including:
Receiving module for receiving the interface call request for calling equipment to send target interface, and records request time, institute
Stating interface call request includes interface type and delay call instruction;
Execution module, for determining that the corresponding interface protocol of the target interface is asynchronous execution class according to the interface type
When type, so that the interface protocol is finished according to the delay call instruction, and is sent to the calling equipment and call feedback
As a result, record sending time;
Statistical module, the interface for obtaining the target interface according to the request time and the sending time are time-consuming.
6. device according to claim 5, which is characterized in that the execution module is also used to:
When determining that the corresponding interface protocol of the target interface executes type to synchronize according to the interface type, described in execution
Interface protocol, and sent to the calling equipment and call feedback result, record sending time.
7. device according to claim 5, which is characterized in that further include sending module, be used for:
When determining that the corresponding interface protocol of the target interface is asynchronous execution type according to the interface type, to the tune
Feedback request is sent with equipment as a result, so that the calling equipment sends corresponding interface call request to next target interface.
8. device according to claim 5, which is characterized in that the statistical module is specifically used for:When according to the request
Between and the sending time obtain interval time, the interface as the target interface is time-consuming.
9. a kind of electronic equipment, which is characterized in that including:Processor, memory, bus and storage on a memory and can located
The computer program run on reason device;
Wherein, the processor, memory complete mutual communication by the bus;
The processor realizes such as method of any of claims 1-4 when executing the computer program.
10. a kind of non-transient computer readable storage medium, which is characterized in that in the non-transient computer readable storage medium
It is stored with computer program, such as side of any of claims 1-4 is realized when which is executed by processor
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810569370.5A CN108920346A (en) | 2018-06-05 | 2018-06-05 | Web server interface time-consuming statistical method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810569370.5A CN108920346A (en) | 2018-06-05 | 2018-06-05 | Web server interface time-consuming statistical method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108920346A true CN108920346A (en) | 2018-11-30 |
Family
ID=64419783
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810569370.5A Pending CN108920346A (en) | 2018-06-05 | 2018-06-05 | Web server interface time-consuming statistical method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108920346A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110275764A (en) * | 2019-05-15 | 2019-09-24 | 阿里巴巴集团控股有限公司 | Call timeout treatment method, apparatus and system |
CN110609771A (en) * | 2019-09-18 | 2019-12-24 | 达疆网络科技(上海)有限公司 | Method for counting time consumption of each internal interface relative to time consumption distribution of current overall request |
CN111339380A (en) * | 2020-03-04 | 2020-06-26 | 北京新氧科技有限公司 | Interface time-consuming data processing method and related device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105262826A (en) * | 2015-10-29 | 2016-01-20 | 福建天晴数码有限公司 | Method and system for adjusting interface processing amount |
CN106911810A (en) * | 2017-04-28 | 2017-06-30 | 杭州迪普科技股份有限公司 | A kind of interface interchange method and apparatus |
CN107070735A (en) * | 2016-12-30 | 2017-08-18 | 上海亿账通互联网科技有限公司 | Method, test terminal and the system of asynchronous interface test |
US20180039440A1 (en) * | 2016-08-03 | 2018-02-08 | Fujitsu Limited | Non-transitory computer-readable recording medium, boundary value specifying method, and boundary value specifying apparatus |
-
2018
- 2018-06-05 CN CN201810569370.5A patent/CN108920346A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105262826A (en) * | 2015-10-29 | 2016-01-20 | 福建天晴数码有限公司 | Method and system for adjusting interface processing amount |
US20180039440A1 (en) * | 2016-08-03 | 2018-02-08 | Fujitsu Limited | Non-transitory computer-readable recording medium, boundary value specifying method, and boundary value specifying apparatus |
CN107070735A (en) * | 2016-12-30 | 2017-08-18 | 上海亿账通互联网科技有限公司 | Method, test terminal and the system of asynchronous interface test |
CN106911810A (en) * | 2017-04-28 | 2017-06-30 | 杭州迪普科技股份有限公司 | A kind of interface interchange method and apparatus |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110275764A (en) * | 2019-05-15 | 2019-09-24 | 阿里巴巴集团控股有限公司 | Call timeout treatment method, apparatus and system |
CN110609771A (en) * | 2019-09-18 | 2019-12-24 | 达疆网络科技(上海)有限公司 | Method for counting time consumption of each internal interface relative to time consumption distribution of current overall request |
CN111339380A (en) * | 2020-03-04 | 2020-06-26 | 北京新氧科技有限公司 | Interface time-consuming data processing method and related device |
CN111339380B (en) * | 2020-03-04 | 2023-12-22 | 北京新氧科技有限公司 | Interface time-consuming data processing method and related device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108768791B (en) | Information acquisition configuration management system and method | |
CN109684228B (en) | Performance test method, device, system and storage medium | |
CN105446827B (en) | Date storage method and equipment when a kind of database failure | |
CN108920346A (en) | Web server interface time-consuming statistical method and device | |
US20220014434A1 (en) | Slice Resource Deployment Method and Apparatus, and Slice Manager and Computer Storage Medium | |
CN109600280B (en) | Pressure testing system, method, device and computer readable storage medium | |
CN107566214B (en) | Performance test method and device | |
CN108536571A (en) | Performance test methods, device, equipment and computer readable storage medium | |
CN107294803A (en) | Response message conformance test method and device | |
CN109491788A (en) | A kind of virtual platform implementation of load balancing and device | |
CN110244991A (en) | A kind of micro services dependency analysis method and device | |
WO2019178957A1 (en) | Distributed system test method and device, computer device and storage medium | |
CN111240812A (en) | Task execution method and device | |
CN108733545B (en) | Pressure testing method and device | |
CN115185787A (en) | Method and device for processing transaction log | |
CN101800672B (en) | Equipment detection method and equipment | |
CN107092556B (en) | Test method, device and equipment | |
CN109600254A (en) | The generation method and related system of full link log | |
CN109257256A (en) | Apparatus monitoring method, device, computer equipment and storage medium | |
CN108924013B (en) | Network flow accurate acquisition method and device | |
KR101968575B1 (en) | Method for automatic real-time analysis for bottleneck and apparatus for using the same | |
CN114428712A (en) | Time consumption statistical method and device | |
CN115705244A (en) | Network asset detection method and device and server | |
CN112650815A (en) | Method and device for synchronizing environmental data, storage medium and electronic device | |
CN110716972A (en) | Method and device for processing error of high-frequency calling external interface |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181130 |
|
RJ01 | Rejection of invention patent application after publication |