CN109165152B - Method, system and storage medium for monitoring performance of WEB system - Google Patents

Method, system and storage medium for monitoring performance of WEB system Download PDF

Info

Publication number
CN109165152B
CN109165152B CN201810860245.XA CN201810860245A CN109165152B CN 109165152 B CN109165152 B CN 109165152B CN 201810860245 A CN201810860245 A CN 201810860245A CN 109165152 B CN109165152 B CN 109165152B
Authority
CN
China
Prior art keywords
performance
web system
monitoring
timestamp
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810860245.XA
Other languages
Chinese (zh)
Other versions
CN109165152A (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.)
Shanghai Hode Information Technology Co Ltd
Original Assignee
Shanghai Hode 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 Shanghai Hode Information Technology Co Ltd filed Critical Shanghai Hode Information Technology Co Ltd
Priority to CN201810860245.XA priority Critical patent/CN109165152B/en
Publication of CN109165152A publication Critical patent/CN109165152A/en
Application granted granted Critical
Publication of CN109165152B publication Critical patent/CN109165152B/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/34Recording 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/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Abstract

The invention relates to a method, a system and a storage medium for monitoring the performance of a WEB system, belonging to the technical field of the Internet. The method comprises the following steps: monitoring a loading event of a WEB system by a monitoring system; after a loading event occurs, reading monitoring data obtained from all interfaces of a browser in the WEB system, and calculating performance data of the WEB system through a timestamp; the medium stores a computer program, and when the computer program is executed by a processor, the performance monitoring method of the WEB system is realized; the performance monitoring system comprises a processor and a memory, wherein the memory is stored with a computer program, and the computer program is executed by the processor to realize the performance monitoring method of the WEB system. Compared with the prior art, the method has the advantages of high accuracy of monitoring data, no need of changing source codes, wide application range and the like.

Description

Method, system and storage medium for monitoring performance of WEB system
Technical Field
The invention relates to the technical field of internet, in particular to the field of WEB front end, and specifically relates to a method, a system and a storage medium for monitoring the performance of a WEB system.
Background
With the development of internet technology, performance monitoring of a WEB system has been more and more widely applied to real life, and an existing WEB performance monitoring method generally adds embedded point information to a key node in a service source code to collect time consumption between points, thereby completing monitoring. The method has a plurality of defects, firstly, the time consumption is counted through the buried points, the accurate time consumption of each stage (such as connection establishment, DNS analysis and content transmission) between the points can not be accurately counted, and only the total time difference can be obtained; secondly, adding a buried point code in a service source code can also increase the execution time of the service source code, so that the counted time consumption is not accurate enough; and once the service source code is updated, a new performance monitoring key node is generated, and the source code needs to be changed to increase the buried point. These all increase the monitoring difficulty of the WEB system, and are inconvenient to operate and implement.
Therefore, how to implement a performance monitoring method for a WEB system, which has high accuracy of monitoring data and does not need to change a source code, becomes an urgent problem to be solved in the field.
Disclosure of Invention
The present invention is directed to a method, a system and a storage medium for monitoring performance of a WEB system.
The purpose of the invention can be realized by the following technical scheme:
a performance monitoring method for a WEB system comprises the following steps:
(1) Monitoring a loading event of a WEB system by a monitoring system;
(2) And after the loading event occurs, reading monitoring data obtained from all interfaces of a browser in the WEB system, and calculating by using a timestamp to obtain performance data of the WEB system.
Preferably, the performance data of the WEB system includes performance data of an entry page and performance data of a key performance node in the page.
Preferably, the step (2) specifically comprises the following steps:
(21) After a loading event occurs, calling a Web Performance API to obtain the monitored data;
(22) And respectively obtaining performance data of an entry page of the WEB system and performance data of key performance nodes in the page of the WEB system through timestamp calculation according to the monitoring data.
Preferably, the method for calculating performance data of the entry page of the WEB system specifically includes: reading timestamp information of all stages of an entry page, wherein the timestamp information comprises a start timestamp and an end timestamp, sequencing all operation stages in the entry page according to an occurrence sequence, and calculating a difference value between the end timestamp and the start timestamp in each operation stage to obtain time consumption information of all operation stages in the entry page as performance data of the entry page of the WEB system.
Preferably, the timestamp information of all the stages of the read entry page is obtained by performance.
Preferably, the performance data of the key performance node in the page of the computational WEB system specifically includes: accessing an entry page, reading timestamp information of high-precision stages of key performance nodes in the page when monitored data indicate that the key performance nodes are generated in the page, wherein the timestamp information comprises a starting timestamp and an ending timestamp, sequencing all the high-precision stages of the key performance nodes according to an occurrence sequence, calculating a difference value between the ending timestamp and the starting timestamp in each high-precision stage, and obtaining time-consuming information of all the high-precision stages of the key performance nodes as performance data of the key performance nodes in the page.
Preferably, the method further comprises: and uploading the performance data of the WEB system to a server.
Preferably, the uploading the performance data of the WEB system to the server specifically includes: storing the performance data of the WEB system into a performance data buffer area; uploading the data in the performance data buffer area to a server according to the set frequency; and clearing the data which is uploaded in the performance data buffer.
A performance monitoring system of a WEB system comprises a processor and a memory, wherein a computer program is stored on the memory, and when the computer program is executed by the processor, the performance monitoring method of the WEB system is realized.
A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements a method of monitoring performance of a WEB system according to any one of the above.
Compared with the prior art, the invention has the following beneficial effects:
(1) The method provided by the invention obtains the monitoring data from all interfaces of the browser in the WEB system through the monitoring system, and obtains the performance data of the WEB system through timestamp calculation.
(2) The monitoring data is obtained through the Web Performance API, and the timestamp information is obtained through the Performance.
(3) When calculating the performance data of the key performance node in the page of the WEB system, and the monitoring data shows that the key performance node is generated in the page, the timestamp information of the key performance node at the high-precision stage is read.
(4) The method can be applied to any WEB system, and is wide in application range and high in compatibility.
Drawings
FIG. 1 is a flowchart illustrating steps of a method for monitoring performance of a WEB system according to the present invention.
Detailed Description
In order to clearly understand the technical contents of the present invention, the following examples are given in detail.
Fig. 1 is a flowchart showing steps of a method for monitoring performance of a WEB system according to the present invention.
In an embodiment, the method for monitoring performance of a WEB system includes the following steps:
(1) Monitoring a loading event of a WEB system by a monitoring system;
(2) And after the loading event occurs, reading monitoring data obtained from all interfaces of the browser in the WEB system, and calculating to obtain performance data of the WEB system through a timestamp.
The performance data of the WEB system comprises performance data of an entry page and performance data of key performance nodes in the page.
The step (2) specifically comprises the following steps:
(21) After a loading event occurs, calling a Web Performance API (application program interface) to obtain the monitoring data;
(22) And respectively obtaining performance data of an entry page of the WEB system and performance data of key performance nodes in the page of the WEB system through timestamp calculation according to the monitoring data.
In the above process, the method for calculating the performance data of the entry page of the WEB system specifically includes: reading timestamp information of all stages of an entry page, wherein the timestamp information comprises a start timestamp and an end timestamp, sequencing all operation stages in the entry page according to an occurrence sequence, calculating a difference value between the end timestamp and the start timestamp in each operation stage, obtaining time consumption information of all operation stages in the entry page, and taking the time consumption information as performance data of the entry page of a WEB system, wherein the timestamp information of all stages of the entry page is specifically obtained through performance.
The specific performance data for calculating the key performance nodes in the page of the WEB system is as follows: the method comprises the steps of accessing an entry page, reading timestamp information of high-precision stages of key performance nodes in the page when monitored data indicate that the key performance nodes are generated in the page, wherein the timestamp information comprises a starting timestamp and an ending timestamp, sequencing all the high-precision stages of the key performance nodes according to an occurrence sequence, calculating a difference value between the ending timestamp and the starting timestamp in each high-precision stage, and obtaining time-consuming information of all the high-precision stages of the key performance nodes to serve as performance data of the key performance nodes in the page.
Besides, the method also comprises the following steps: uploading the performance data of the WEB system to a server, specifically: storing the performance data of the WEB system into a performance data buffer area; uploading the data in the performance data buffer area to a server according to the set frequency; and clearing the data which is uploaded in the performance data buffer.
In addition, the embodiment further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the performance monitoring method for the WEB system according to any one of the foregoing methods; and a performance monitoring system of a WEB system, comprising a processor and a memory, wherein the memory is stored with a computer program, and when the computer program is executed by the processor, the performance monitoring method of the WEB system according to any one of the above is implemented.
In practical applications, a specific implementation manner of the performance monitoring method of the WEB system of the present invention is described by the following embodiments.
Example 1
In this embodiment, when monitoring the performance of the WEB system, a plurality of interfaces of a host environment-browser running the WEB system are first called to obtain performance-related data, and the specific process is as follows:
the monitoring system monitors a "load" event (i.e., a loading event) of a page in the WEB system, and starts to perform subsequent performance monitoring operations after monitoring that the loading event occurs, in this embodiment, corresponding operations are performed after monitoring that the loading event occurs for 2 seconds, and this time is changed according to actual conditions.
And after the loading event is monitored, calling a Web Performance API to acquire corresponding monitored data, and performing timestamp calculation according to the monitored data so as to acquire Performance data of the entry page and Performance data of key Performance nodes in the page.
The specific process of obtaining the performance data of the entry page comprises the following steps: the method comprises the steps of firstly obtaining start and end timestamps of all stages of an entry page through a performance.timing interface, sequencing the stages according to the occurrence sequence of the stages, and subtracting the timestamp of the start stage from the timestamp of each stage to obtain the time consumption from the start to each stage, namely the performance data of the entry page.
The specific process of obtaining the performance data of the key performance nodes in the page is as follows: the method comprises the steps that due to the occurrence of a loading event, a plurality of corresponding key performance nodes can be generated in a page, in order to obtain performance data of the key performance nodes, access to an entry page is obtained through a performance. GetEntries interface, timestamp information of high-precision stages of the key performance nodes, including a start timestamp and an end timestamp, is obtained through the performance. Timing interface, all the high-precision stages of the key performance nodes are sequenced according to the occurrence sequence, the difference value between the end timestamp and the start timestamp in each high-precision stage is calculated, and time-consuming information of all the high-precision stages of the key performance nodes is obtained and used as the performance data of the key performance nodes in the page.
And generating new key performance nodes in the page along with the continuous progress of the loading event, wherein at the moment, the PerformanceObserver interface can inform the monitoring system after the new key performance nodes are generated, and after the monitoring system receives the notice, the monitoring system acquires the corresponding performance data of the newly generated key performance nodes according to the same method, so that the monitoring system is ensured to acquire the performance data of all the key performance nodes.
After the monitoring system calculates and obtains the performance data of the entry page and the performance data of the key performance nodes in the page, the monitoring system can temporarily store the data in the performance data buffer area, and upload the data in the performance data buffer area to the server according to a certain time interval, wherein the time interval can be flexibly set according to the actual situation and has no fixed requirement. After the data in the performance data buffer area is uploaded to the server, the performance data buffer area can be cleared through a performance.
In the actual layout process, the monitoring system for implementing the method is introduced before the WEB system entry page source code is finished, the specific execution command is "< script src ="// static. Hdslb.com/public/timing.min. Js "> < script >, and after the monitoring system is introduced, the address reported by the data can be changed according to the actual situation and the interface provided by the monitoring system, and the interface for specifically executing the operation is performancelog. The monitoring system is introduced before the system entry page source code is finished, so that the detailed performance information of each stage of the performance key node can be accurately counted; meanwhile, the monitoring code does not invade the service source code, the execution of the service source code is not influenced, and any embedded point code is not required to be added in the service source code; for newly added monitoring key nodes, source codes do not need to be changed, and meanwhile, the method has universality and can be implemented in any WEB system.
By the method and the system, the performance of the WEB system can be effectively monitored, and the monitoring method is actually tried out, so that a good monitoring effect is obtained.
Example 2
The performance monitoring method of the WEB system in this embodiment is substantially the same as the editing process in embodiment 1, except that in the present embodiment, in the process of obtaining performance data of key performance nodes in a page, after a loading event occurs, corresponding key performance nodes do not appear in the page temporarily, at this time, the monitoring system only performs an operation of obtaining performance data of an entry page, along with continuous progress of the loading event, a plurality of new key performance nodes are generated in the page, at this time, a performance observer interface can notify the monitoring system after the new key performance nodes are generated, after receiving the notification, the monitoring system obtains access to the entry page through a performance.
In this specification, the invention has been described with reference to specific embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.

Claims (8)

1. A method for monitoring the performance of a WEB system is characterized by comprising the following steps:
(1) Monitoring a loading event of a WEB system by a monitoring system;
(2) After a loading event occurs, reading monitoring data obtained from all interfaces of a browser in a WEB system, calculating to obtain performance data of the WEB system through a timestamp, wherein the performance data of the WEB system comprises performance data of an entry page and performance data of key performance nodes in the page, and when a new key performance node is generated in the page, a monitoring system obtains a notice and obtains the performance data of the new key performance node,
the performance data of the key performance node is obtained in the following mode: reading timestamp information of high-precision stages of key performance nodes in a page, wherein the timestamp information comprises a start timestamp and an end timestamp, sequencing all the high-precision stages of the key performance nodes according to an occurrence sequence, and calculating a difference value between the end timestamp and the start timestamp in each high-precision stage to obtain time-consuming information of all the high-precision stages of the key performance nodes as performance data of the key performance nodes.
2. The method for monitoring performance of a WEB system according to claim 1, wherein after a loading event occurs, the method reads monitored data obtained from all interfaces of a browser in the WEB system, and obtains performance data of the WEB system through timestamp calculation, and specifically includes:
after a loading event occurs or a new key Performance node is generated in a page, calling a Web Performance API (application program interface) to obtain the monitoring data;
and respectively obtaining performance data of an entry page of the WEB system and performance data of key performance nodes in the page of the WEB system by timestamp calculation according to the monitoring data.
3. The method for monitoring performance of a WEB system according to claim 2, wherein the method for calculating the performance data of the entry page of the WEB system specifically comprises: reading timestamp information of all stages of an entry page, wherein the timestamp information comprises a start timestamp and an end timestamp, sequencing all operation stages in the entry page according to an occurrence sequence, and calculating a difference value between the end timestamp and the start timestamp in each operation stage to obtain time consumption information of all operation stages in the entry page, wherein the time consumption information is used as performance data of the entry page of the WEB system.
4. The method for monitoring performance of a WEB system according to claim 3, wherein the reading of the timestamp information of all stages of the entry page is specifically to obtain the timestamp information through performance.
5. The method for monitoring the performance of a WEB system according to claim 1, further comprising: and uploading the performance data of the WEB system to a server.
6. The method for monitoring performance of a WEB system according to claim 5, wherein the uploading the performance data of the WEB system to a server specifically includes: storing the performance data of the WEB system into a performance data buffer area; uploading the data in the performance data buffer area to a server according to the set frequency; and clearing the data which is uploaded in the performance data buffer.
7. A performance monitoring system for a WEB system, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program is executed by the processor to implement the performance monitoring method for a WEB system according to any one of claims 1 to 6.
8. A computer-readable storage medium on which a computer program is stored, the computer program being characterized by implementing a method for monitoring performance of a WEB system according to any one of claims 1 to 6 when executed by a processor.
CN201810860245.XA 2018-07-31 2018-07-31 Method, system and storage medium for monitoring performance of WEB system Active CN109165152B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810860245.XA CN109165152B (en) 2018-07-31 2018-07-31 Method, system and storage medium for monitoring performance of WEB system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810860245.XA CN109165152B (en) 2018-07-31 2018-07-31 Method, system and storage medium for monitoring performance of WEB system

Publications (2)

Publication Number Publication Date
CN109165152A CN109165152A (en) 2019-01-08
CN109165152B true CN109165152B (en) 2022-11-15

Family

ID=64898414

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810860245.XA Active CN109165152B (en) 2018-07-31 2018-07-31 Method, system and storage medium for monitoring performance of WEB system

Country Status (1)

Country Link
CN (1) CN109165152B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625432B (en) * 2019-02-28 2023-03-28 北京字节跳动网络技术有限公司 Page loading time consumption determination method and device and computer readable storage medium
CN112416726A (en) * 2020-11-20 2021-02-26 深圳开源互联网安全技术有限公司 Method and device for analyzing static resource loading performance of WEB application
CN112965718A (en) * 2021-05-19 2021-06-15 南京视察者智能科技有限公司 SDK module for monitoring web front-end error and performance and calling method thereof
CN113238917B (en) * 2021-05-31 2023-10-31 康键信息技术(深圳)有限公司 Front-end performance monitoring method, device, equipment and storage medium
CN113569168A (en) * 2021-06-17 2021-10-29 北京健康之家科技有限公司 Page performance data generation method and device, computer storage medium and terminal
CN115065620B (en) * 2022-06-20 2023-08-22 中国平安财产保险股份有限公司 Network monitoring method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101087312A (en) * 2006-06-02 2007-12-12 软件股份公司 System and method for managing web services
CN106570013A (en) * 2015-10-09 2017-04-19 北京国双科技有限公司 Method and device for processing page access data
CN108205487A (en) * 2016-12-20 2018-06-26 广州市动景计算机科技有限公司 A kind of method, apparatus and user terminal for monitoring browser performance

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678372B (en) * 2012-09-14 2019-05-07 北京百度网讯科技有限公司 A kind of method and apparatus for obtaining the application performance of the page
US11671312B2 (en) * 2014-10-09 2023-06-06 Splunk Inc. Service detail monitoring console
CN106598821B (en) * 2015-10-14 2020-11-17 腾讯科技(深圳)有限公司 Method and device for testing webpage loading speed
CN106502902B (en) * 2016-10-25 2019-03-22 中国工商银行股份有限公司 Web page operational efficiency monitoring method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101087312A (en) * 2006-06-02 2007-12-12 软件股份公司 System and method for managing web services
CN106570013A (en) * 2015-10-09 2017-04-19 北京国双科技有限公司 Method and device for processing page access data
CN108205487A (en) * 2016-12-20 2018-06-26 广州市动景计算机科技有限公司 A kind of method, apparatus and user terminal for monitoring browser performance

Also Published As

Publication number Publication date
CN109165152A (en) 2019-01-08

Similar Documents

Publication Publication Date Title
CN109165152B (en) Method, system and storage medium for monitoring performance of WEB system
JP2006031109A (en) Management system and management method
CN101571827A (en) Method for saving logs and log system
CN104866510A (en) Method and device for removing residual file and method and device for establishing feature library of residual file
US10868873B2 (en) Communication session log analysis device, method and recording medium
CN113961510B (en) File processing method, device, equipment and storage medium
CN110647514A (en) Metadata updating method and device and metadata server
CN112269534A (en) Data reading method, device and equipment and computer readable storage medium
CN104239091A (en) File cleaning method and device and terminal
CN104216802A (en) Memory database recovery method and device
CN109462507B (en) Configuration updating method, device and system and electronic equipment
CN108108126B (en) Data processing method, device and equipment
CN104348905A (en) Method and device for pushing message in off-line way
CN112000850B (en) Method, device, system and equipment for processing data
CN111488117B (en) Method, electronic device, and computer-readable medium for managing metadata
CN112328602A (en) Method, device and equipment for writing data into Kafka
CN114168119B (en) Code file editing method, device, electronic equipment and storage medium
CN115328736A (en) Probe deployment method, device, equipment and storage medium
CN103618961A (en) Method, system and browser for displaying video title
CN111538651A (en) Interface testing method, device, server and storage medium
CN111881281A (en) Log processing method, device, equipment and medium
CN113568795B (en) Static service testing method, device, equipment and storage medium
CN110597828A (en) Database changing method, device, equipment and storage medium
JP2014235675A (en) Data processing apparatus and data processing method
CN112988247B (en) Log processing method and device, electronic equipment and readable storage medium

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20191008

Address after: 201203 Shanghai City, Pudong New Area China (Shanghai) free trade zone 2277 Zuchongzhi Road No. 1 Lane 905, room 906

Applicant after: SHANGHAI HODE INFORMATION TECHNOLOGY Co.,Ltd.

Address before: Room 1641, room 1945, Siping Road, Yangpu District, Shanghai

Applicant before: SHANGHAI BILIBILI TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant