CN112306791A - Method and device for monitoring performance - Google Patents

Method and device for monitoring performance Download PDF

Info

Publication number
CN112306791A
CN112306791A CN201910706557.XA CN201910706557A CN112306791A CN 112306791 A CN112306791 A CN 112306791A CN 201910706557 A CN201910706557 A CN 201910706557A CN 112306791 A CN112306791 A CN 112306791A
Authority
CN
China
Prior art keywords
interface
data
interface data
request
reporting
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.)
Granted
Application number
CN201910706557.XA
Other languages
Chinese (zh)
Other versions
CN112306791B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201910706557.XA priority Critical patent/CN112306791B/en
Publication of CN112306791A publication Critical patent/CN112306791A/en
Application granted granted Critical
Publication of CN112306791B publication Critical patent/CN112306791B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a performance monitoring method and device, and relates to the technical field of computers. One specific implementation mode of the method comprises the steps of acquiring data in the page loading process through a performance monitoring interface provided by a browser; classifying the data according to the resource type to identify interface data; and acquiring the loading time corresponding to the interface data, and sending the interface data and the corresponding loading time based on the delayed reporting parameter of the page loading completion event. Therefore, the method and the device can solve the problems of high coupling of the monitoring code and the service code and time and labor consumption in service development.

Description

Method and device for monitoring performance
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for monitoring performance.
Background
As mobile devices become better and better, support for HTML5 (hereinafter referred to as H5) by mobile browsers becomes more sophisticated. Meanwhile, the H5 page can be issued across Android and IOS dual platforms only by once development, and can be iterated quickly without auditing, so that H5 is more and more applied to some projects with short requirement periods and quick iteration. However, H5 gives users different experiences due to congenital needs of loading resource short boards, resource loading speed, interface performance, page implementation principle, etc., and only by continuous optimization from various aspects, the optimal experience can be given to users. Therefore, monitoring of interface performance and loading of static resources becomes a necessary task.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
at present, the H5 project has the characteristics of short development period, complex service and the like, and if monitoring codes are added to related service codes, a large amount of development time and labor cost are wasted. In addition, the monitoring code and the service code are highly coupled with each other, and readability is poor.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for performance monitoring, which can solve the problems of high coupling between a monitoring code and a service code, and time and labor consumption in service development.
In order to achieve the above object, according to an aspect of the embodiments of the present invention, a method for performance monitoring is provided, including acquiring data in a page loading process through a performance monitoring interface provided by a browser; classifying the data according to the resource type to identify interface data; and acquiring the loading time corresponding to the interface data, and sending the interface data and the corresponding loading time based on the delayed reporting parameter of the page loading completion event.
Optionally, classifying the data according to resource type to identify the interface data includes:
identifying data with a preset resource type according to an object initiating a data request;
and screening the interface data from the data with the preset resource type based on the interface calling method.
Optionally, before sending the interface data and the corresponding loading time, the method includes:
setting a service type parameter of an interface request in interface data to mark the service of the interface data; setting a service type parameter based on the interface request access; or
Acquiring interface calling parameters and interface request entry parameters of interface data;
judging whether interface data with the same interface calling parameters and interface request access parameters exist in a reporting queue, if so, obtaining count values corresponding to all the interface data with the same interface calling parameters and interface request access parameters in the reporting queue, adding 1 to the maximum count value, giving the interface data, and putting the interface data and the interface data into the reporting queue; otherwise, setting the count value of the interface data as 1, and putting the interface data and the count value into a reporting queue.
Optionally, before sending the interface data and the corresponding loading time, the method further includes:
acquiring page address information in interface data;
and identifying corresponding interface data based on the uniform resource locator after the address information of the page is subjected to parameter removal.
In addition, according to an aspect of the embodiments of the present invention, there is provided a performance monitoring apparatus, including an obtaining module, configured to obtain data in a page loading process through a performance monitoring interface provided by a browser; the identification module is used for classifying the data according to the resource type so as to identify the interface data; and the reporting module is used for acquiring the loading time corresponding to the interface data, and sending the interface data and the corresponding loading time based on the delayed reporting parameter of the page loading completion event.
Optionally, the classifying module classifies the data according to the resource type to identify the interface data, including:
identifying data with a preset resource type according to an object initiating a data request;
and screening the interface data from the data with the preset resource type based on the interface calling method.
Optionally, the method further comprises:
the marking module is used for setting the service type parameter of the interface request in the interface data so as to mark the service of the interface data; setting a service type parameter based on the interface request access; or
Acquiring interface calling parameters and interface request entry parameters of interface data;
judging whether interface data with the same interface calling parameters and interface request access parameters exist in a reporting queue, if so, obtaining count values corresponding to all the interface data with the same interface calling parameters and interface request access parameters in the reporting queue, adding 1 to the maximum count value, giving the interface data, and putting the interface data and the interface data into the reporting queue; otherwise, setting the count value of the interface data as 1, and putting the interface data and the count value into a reporting queue.
Optionally, the method further comprises:
and the marking module is used for acquiring page address information in the interface data and identifying the corresponding interface data based on the uniform resource locator after the page address information is subjected to parameter removal.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any of the performance monitoring embodiments described above.
According to another aspect of an embodiment of the present invention, there is also provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method according to any of the above-mentioned embodiments based on performance monitoring.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of acquiring data in a page loading process through a performance monitoring interface provided by a browser; classifying the data according to the resource type to identify interface data; and acquiring the loading time corresponding to the interface data, and sending the interface data and the corresponding loading time based on the delayed reporting parameter of the page loading completion event. Therefore, the invention separates the monitoring of the interface performance from the business development, improves the business development efficiency and optimizes the business code.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a method of performance monitoring according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a main flow of a method of performance monitoring according to another embodiment of the invention;
FIG. 3 is a schematic diagram of a main flow of performing service tagging on interface data after screening according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the main modules of an apparatus for performance monitoring according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the main modules of an apparatus for performance monitoring according to another embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 7 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a method of performance monitoring according to a first embodiment of the present invention, which may include:
step S101, acquiring data in the page loading process through a performance monitoring interface provided by the browser.
Step S102, classifying the data according to the resource type to identify the interface data.
In an embodiment, data having a preset resource type is identified based on the object from which the data request originated. Preferably, data having initiatorType attribute values xmlhttrequest and script is identified by traversing the data queue. Then, since not all xmlhttrequest requests are interface requests, there may be some other requests. Therefore, based on the interface calling method, the interface data is screened out from the data with the preset resource type.
Wherein initiatorType is an attribute of getEntries () method in perfermance, representing who initiated the request. I.e., an attribute of the returned entity, as indicated by the type of the returned entity.
The xmlhttrequest is an extensible hypertext transfer request, and the script can contain a script statement and can also point to an external script file through an src attribute.
Step S103, acquiring the loading time corresponding to the interface data, and sending the interface data and the loading time corresponding to the interface data based on the delayed reporting parameter of the page loading completion event.
In an embodiment, npm packets or a cdn address may be generated for the service code to call based on steps S101 through S103. Among them, npm (node package manager) is a way to share code or reuse code. cdn is called Content Delivery Network, i.e. Content distribution Network.
In a preferred embodiment of the present invention, the interface call parameter values of many interface requests are the same, but the entries of the interface requests are different, and the response results thereof are also very different. That is, for the service requirement, the different request contents (entries) for the same interface call have different meanings. Therefore, the invention sets the service type parameter of the interface request in the interface data to mark the service of the interface data. Wherein the service type parameter is set based on the interface request entry. I.e. statistics on traffic demands can be performed on the interface data.
It should be noted that, for counting the interface data according to the service requirement, the parameters may be called by the interface and the parameters may be requested by the interface to obtain the interface data. And then judging whether interface data with the same interface calling parameters and interface request access parameters exist in the reporting queue, if so, obtaining count values corresponding to all the interface data with the same interface calling parameters and interface request access parameters in the reporting queue, adding 1 to the maximum count value, giving the interface data, and putting the interface data together with the interface data into the reporting queue. Otherwise, setting the count value of the interface data as 1, and putting the interface data and the count value into a reporting queue.
In addition, as an embodiment of the present invention, how to let the service end identify which reported item the reported interface data is without intervention of the service code can obtain the page address information in the interface data. Then, based on the uniform resource locator after the address information of the page is removed, corresponding interface data is identified, that is, the page to which the interface belongs can be identified.
Fig. 2 is a schematic diagram of a main flow of a performance monitoring method according to another embodiment of the present invention, which may include, based on an H5 front end:
step S201, acquiring data of all resources in the network loading process through a performance monitoring interface provided by the browser.
Preferably, the method of window, performance, getentries is adopted, and the relevant data of the network loading process of all resources is acquired through a performance monitoring interface API provided by a browser. The data has the advantages of complete coverage, complete information, high data accuracy and the like, and comprises html, css.js scripts, pictures and transmitted requests. The type of the mark may include link, script, xmlhttrequest, css, first-paint, img, and the like.
It should be noted that the performance is an interface API for resource response time provided by the browser, and may obtain each stage time and loading time of all resources in the page loading process.
Step S202, identifying the data of which the initiatorType attribute value is xmlhttrequest and script by traversing the data queue.
In an embodiment, after data provided by the perfermance is obtained, the data queue is filtered. Preferably, data having initiatorType attribute values xmlhttrequest and script is identified by traversing the data queue.
It should be noted that the interface data is mainly in xmlhttrequest and script, the former performs asynchronous request in the form of ajax (ajax refers to asynchronous JavaScript and XML), and the latter performs request in the form of jsonp. Wherein json with padding is used to solve the problem of cross-domain data access of mainstream browsers.
Wherein initiatorType is an attribute of getEntries () method in perfermance, representing who initiated the request. I.e., an attribute of the returned entity, as indicated by the type of the returned entity.
The xmlhttrequest is an extensible hypertext transfer request, and the script can contain a script statement and can also point to an external script file through an src attribute.
Step S203, the identified data is filtered to obtain interface data.
In the embodiment, since not all xmlhttrequest requests are interface requests, other requests, such as some report requests without response, are also possible. Similarly, the script is the same, for example, the js file introduced through the script tag is also of script type, but not interface data. Therefore, the data with initiatorType attribute values of xmlhttrequest and script is screened to obtain the interface data.
Preferably, according to the interface calling method, it is determined whether the identified data is an interface request, if so, step S204 is performed, otherwise, the data is deleted, and the process is exited. That is, whether the data is an interface request and thus is interface data may be determined by calling a method to an interface in the identified data. For example: some interface calling methods adopt a gateway unified request, and some interface calling methods can determine that the data is an interface request through pathname.
And step S204, according to the service requirement, carrying out service marking on the screened interface data.
In an embodiment, the interface call parameter values of many interface requests are the same, but the entries of the interface requests are different, for example: the path names of the interface calls are the same (for example, the pathname values are the same, or the functional id values are the same), but the response results of the requests differ greatly from the entries of the requests. That is, for the service requirement, the different request contents (entries) for the same interface call have different meanings. Therefore, the invention makes statistics on the screened interface data according to the service requirements.
Furthermore, a service type parameter of the interface request is set in the interface data, so as to implement service marking on the screened interface data according to the service requirement.
Preferably, an entry may be marked in the sent request, that is, a service type parameter, such as monitoname, is added to the parameter of the request, and the service type parameter of the interface request exists in the obtained interface data. Therefore, the monitoring can be directly carried out according to the service type parameters and reported to the server side.
In another further embodiment, when performing service classification on the screened interface data according to the service requirement, a parameter setting counter may also be entered for an interface request in the interface data. The implementation process comprises the following steps:
step S301: and acquiring interface calling parameters and interface request entry parameters of the interface data.
Step S302: and judging whether interface data with the same interface calling parameters and interface request access parameters exist in the reporting queue, if so, performing step S403, and otherwise, performing step S404.
Step S303: and obtaining the count values corresponding to all interface data with the same interface calling parameters and interface request parameter entering in the reporting queue, adding 1 to the maximum count value, giving the interface data, and putting the interface data and the interface data into the reporting queue.
Step S304: setting the count value of the interface data as 1, and putting the interface data and the count value into a reporting queue.
It should be noted that steps S301 to S304 can be applied to the case of the request of the interface serial.
Step S205, the url with location.
In the embodiment, how to let the service code not interfere with the service code is to let the server identify which reported item the reported interface data is, and the url whose parameter is removed by the location. Therefore, the service code is ensured not to be participated in, and the uniqueness of the mark is ensured.
Wherein url (Uniform Resource Locator) is a standard Resource address on the internet. Href is to obtain the complete address of the current page.
Step S206, acquiring the loading time corresponding to the interface data, and assembling the loading time with the interface data as reported data.
In the embodiment, the loading time of the received response data and the corresponding interface data can be assembled according to the contract format of the server.
Step S207, based on the delayed reporting parameter of the page loading completion event, the reported data is sent.
In an embodiment, an event that a page load is complete, such as window. Such as: onload event is performed after the first loading of some static resources and pictures of a page, and the window onpageshow event is triggered each time a page is loaded. That is, the page rendering does not start until the interface returns response data, for example, the act renders the interface for the first time before the interface responds. Therefore, if the monitoring and reporting are performed based on the event that the page loading is completed, data such as the loading time of the interface cannot be obtained.
Further, a delayed reporting parameter may be set for the page load completion event, for example, a setTimeout is set in the page load completion event, such as window.
Preferably, if the delay reporting parameter is too short, the interface does not respond, and the request is sent out, which may result in incomplete reported data, and if it is too long to exceed the user stay time, the reported data may be lost, so the delay reporting parameter may be set to 2s to 5 s.
It should be noted that the reporting data may also be sent without the delay reporting parameter of the page loading completion event. That is, the authority of the reporting time can be given to the service code, and the service code sends the reported data after waiting for the interface response.
It should be noted that, after receiving the reported data, the server side lands on the ground and aggregates the reported data according to TP percentage, for example, according to TP15, TP30, TP50, TP75, and TP90 dimensions for display. Further, when the landing data is large, the landing data can be deleted at regular time, and the aggregated result data is stored, so that the burden of the server side can be greatly reduced.
Wherein TP is Top Percentile, percentage of Top. For example: the TP75 ranks the interface elapsed time from small to large, taking the top 75% of the maximum elapsed time, i.e., 75% of users can be responded to within this time.
Preferably, when the reported data after landing is aggregated, invalid or abnormal data (for example, the interface duration is 0, or is greater than a preset upper threshold value, etc.) can be removed first, so as to ensure the validity and accuracy of the whole data. Additionally, a visual interface may be provided when presenting the aggregated results.
Therefore, according to the various embodiments, the automatic reporting and monitoring of the time consumption of the H5 page interface, which is provided by the invention, realizes the monitoring of the performance of the interface which is accessed by a service developer without sensing, thereby reducing the development workload and enhancing the readability of the code. In addition, the data extracted from the browser self-contained method has higher reliability.
Furthermore, from the service level, the invention can automatically report the interface time-consuming data. Therefore, the complexity of service development is reduced, developers only need to pay attention to the development of service logic and do not need to consider monitoring of interface performance, the development workload is reduced, and the development efficiency is effectively improved. From the code level, the invention completely decouples the performance monitoring and the service logic, and further the code logic becomes clear and the readability is enhanced.
In addition, for the monitoring code of the interface, the invention uploads npm the relevant processing code (the relevant processing code is the code for realizing the automatic performance monitoring of the invention) (npm is a packet management tool of JavaScript and is a default packet management tool of node. js platform, and the code can be installed, shared and distributed through npm), the service side only needs to import the code, and the monitoring of the interface performance can be realized without writing any monitoring code, thereby reducing the workload of development.
Fig. 4 is a performance monitoring apparatus according to an embodiment of the present invention, and as shown in fig. 4, the performance monitoring apparatus 400 includes an obtaining module 401, an identifying module 402, and a reporting module 403. The obtaining module 401 obtains data in the page loading process through a performance monitoring interface provided by the browser. The identification module 402 categorizes the data according to the resource type to identify the interface data. The reporting module 403 obtains the loading time corresponding to the interface data, and sends the interface data and the loading time corresponding to the interface data based on the delayed reporting parameter of the page loading completion event.
Preferably, the identification module 402 classifies the data according to the resource type to identify the interface data, and may identify the data with the preset resource type according to the object that initiates the data request. And screening the interface data from the data with the preset resource type based on the interface calling method.
Fig. 5 is a performance monitoring apparatus according to another embodiment of the present invention, and as shown in fig. 5, the performance monitoring apparatus 500 includes an obtaining module 501, an identifying module 502, a reporting module 503, and a marking module 504. The obtaining module 501 obtains data in the page loading process through a performance monitoring interface provided by the browser. The identification module 502 classifies the data according to resource type to identify interface data. The reporting module 503 obtains the loading time corresponding to the interface data, and sends the interface data and the corresponding loading time based on the delayed reporting parameter of the page loading completion event. The marking module 504 sets a service type parameter of the interface request in the interface data to mark the interface data for service. Wherein the service type parameter is set based on the interface request entry. Or
The marking module 504 obtains the interface call parameter and the interface request entry parameter of the interface data.
And judging whether interface data with the same interface calling parameters and interface request access parameters exist in the reporting queue. If the interface data exists, the corresponding count values of all the interface data with the same interface calling parameters and interface request access parameters in the reporting queue are obtained, the interface data are given after the maximum count value is added with 1, and the interface data are placed into the reporting queue. Otherwise, setting the count value of the interface data as 1, and putting the interface data and the count value into a reporting queue.
In addition, the marking module 504 may further obtain page address information in the interface data, and identify corresponding interface data based on the uniform resource locator after the page address information is removed.
It should be noted that, the method for monitoring performance and the apparatus for monitoring performance according to the present invention have corresponding relation in the specific implementation content, so the repeated content is not described again.
Fig. 6 shows an exemplary system architecture 600 of a performance monitoring apparatus or method to which embodiments of the invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for performance monitoring provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the apparatus for performance monitoring is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the system 700 are also stored. The CPU701, the ROM702, and the RAM703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises an acquisition module, an identification module and a reporting module. Wherein the names of the modules do not in some cases constitute a limitation of the module itself.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to include a performance monitoring interface provided by a browser to obtain data during page loading; classifying the data according to the resource type to identify interface data; and acquiring the loading time corresponding to the interface data, and sending the interface data and the corresponding loading time based on the delayed reporting parameter of the page loading completion event.
According to the technical scheme of the embodiment of the invention, the problems of high coupling of the monitoring code and the service code and time and labor consumption in service development can be solved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of performance monitoring, comprising:
acquiring data in a page loading process through a performance monitoring interface provided by a browser;
classifying the data according to the resource type to identify interface data;
and acquiring the loading time corresponding to the interface data, and sending the interface data and the corresponding loading time based on the delayed reporting parameter of the page loading completion event.
2. The method of claim 1, wherein categorizing the data according to resource type to identify the interface data comprises:
identifying data with a preset resource type according to an object initiating a data request;
and screening the interface data from the data with the preset resource type based on the interface calling method.
3. The method of claim 1, wherein sending the interface data and its corresponding load time is preceded by:
setting a service type parameter of an interface request in interface data to mark the service of the interface data; setting a service type parameter based on the interface request access; or
Acquiring interface calling parameters and interface request entry parameters of interface data;
judging whether interface data with the same interface calling parameters and interface request access parameters exist in a reporting queue, if so, obtaining count values corresponding to all the interface data with the same interface calling parameters and interface request access parameters in the reporting queue, adding 1 to the maximum count value, giving the interface data, and putting the interface data and the interface data into the reporting queue; otherwise, setting the count value of the interface data as 1, and putting the interface data and the count value into a reporting queue.
4. The method of any of claims 1-3, wherein prior to sending the interface data and its corresponding load time, further comprising:
acquiring page address information in interface data;
and identifying corresponding interface data based on the uniform resource locator after the address information of the page is subjected to parameter removal.
5. An apparatus for performance monitoring, comprising:
the acquisition module is used for acquiring data in the page loading process through a performance monitoring interface provided by the browser;
the identification module is used for classifying the data according to the resource type so as to identify the interface data;
and the reporting module is used for acquiring the loading time corresponding to the interface data, and sending the interface data and the corresponding loading time based on the delayed reporting parameter of the page loading completion event.
6. The apparatus of claim 5, wherein the identification module categorizes the data according to resource type to identify the interface data, comprising:
identifying data with a preset resource type according to an object initiating a data request;
and screening the interface data from the data with the preset resource type based on the interface calling method.
7. The apparatus of claim 5, further comprising:
the marking module is used for setting the service type parameter of the interface request in the interface data so as to mark the service of the interface data; setting a service type parameter based on the interface request access; or
Acquiring interface calling parameters and interface request entry parameters of interface data;
judging whether interface data with the same interface calling parameters and interface request access parameters exist in a reporting queue, if so, obtaining count values corresponding to all the interface data with the same interface calling parameters and interface request access parameters in the reporting queue, adding 1 to the maximum count value, giving the interface data, and putting the interface data and the interface data into the reporting queue; otherwise, setting the count value of the interface data as 1, and putting the interface data and the count value into a reporting queue.
8. The apparatus of any of claims 5-7, further comprising:
and the marking module is used for acquiring page address information in the interface data and identifying the corresponding interface data based on the uniform resource locator after the page address information is subjected to parameter removal.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN201910706557.XA 2019-08-01 2019-08-01 Performance monitoring method and device Active CN112306791B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910706557.XA CN112306791B (en) 2019-08-01 2019-08-01 Performance monitoring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910706557.XA CN112306791B (en) 2019-08-01 2019-08-01 Performance monitoring method and device

Publications (2)

Publication Number Publication Date
CN112306791A true CN112306791A (en) 2021-02-02
CN112306791B CN112306791B (en) 2024-05-17

Family

ID=74485393

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910706557.XA Active CN112306791B (en) 2019-08-01 2019-08-01 Performance monitoring method and device

Country Status (1)

Country Link
CN (1) CN112306791B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112965718A (en) * 2021-05-19 2021-06-15 南京视察者智能科技有限公司 SDK module for monitoring web front-end error and performance and calling method thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080104224A1 (en) * 2006-10-27 2008-05-01 Litofsky Richard T Method and apparatus for determining application responsiveness over a network
CN106021078A (en) * 2016-05-06 2016-10-12 北京蓝海讯通科技股份有限公司 A performance monitoring method and device and a monitoring apparatus
CN107528870A (en) * 2016-06-22 2017-12-29 腾讯科技(深圳)有限公司 A kind of collecting method and its equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080104224A1 (en) * 2006-10-27 2008-05-01 Litofsky Richard T Method and apparatus for determining application responsiveness over a network
CN106021078A (en) * 2016-05-06 2016-10-12 北京蓝海讯通科技股份有限公司 A performance monitoring method and device and a monitoring apparatus
CN107528870A (en) * 2016-06-22 2017-12-29 腾讯科技(深圳)有限公司 A kind of collecting method and its equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112965718A (en) * 2021-05-19 2021-06-15 南京视察者智能科技有限公司 SDK module for monitoring web front-end error and performance and calling method thereof

Also Published As

Publication number Publication date
CN112306791B (en) 2024-05-17

Similar Documents

Publication Publication Date Title
CN111427701A (en) Workflow engine system and business processing method
CN110321252B (en) Skill service resource scheduling method and device
CN113517985B (en) File data processing method and device, electronic equipment and computer readable medium
CN112118352B (en) Method and device for processing notification trigger message, electronic equipment and computer readable medium
CN115525411A (en) Method, device, electronic equipment and computer readable medium for processing service request
CN113190558A (en) Data processing method and system
CN112306791B (en) Performance monitoring method and device
CN113127335A (en) System testing method and device
CN110909269B (en) Log reporting method and device
CN113114611B (en) Blacklist management method and device
CN113238919A (en) Statistical method, device and system for user access number
CN113448652A (en) Request processing method and device
CN112688982A (en) User request processing method and device
CN113722193A (en) Method and device for detecting page abnormity
CN110868477A (en) Task scheduling method, device and system
CN111415262A (en) Service processing method and device
CN113434754A (en) Method and device for determining recommended API (application program interface) service, electronic equipment and storage medium
CN110728009A (en) Simulation method, device and system
CN113157828B (en) Method and device for pushing data
CN113766437B (en) Short message sending method and device
CN113064678B (en) Cache configuration method and device
CN112448931B (en) Network hijacking monitoring method and device
CN115840604B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN115333871B (en) Firewall operation and maintenance method and device, electronic equipment and readable storage medium
CN112783665B (en) Interface compensation method and device

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