CN111290912A - Single-page application performance monitoring method and device and electronic equipment - Google Patents

Single-page application performance monitoring method and device and electronic equipment Download PDF

Info

Publication number
CN111290912A
CN111290912A CN202010074083.4A CN202010074083A CN111290912A CN 111290912 A CN111290912 A CN 111290912A CN 202010074083 A CN202010074083 A CN 202010074083A CN 111290912 A CN111290912 A CN 111290912A
Authority
CN
China
Prior art keywords
page
page application
performance
running state
loading
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
Application number
CN202010074083.4A
Other languages
Chinese (zh)
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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010074083.4A priority Critical patent/CN111290912A/en
Publication of CN111290912A publication Critical patent/CN111290912A/en
Pending legal-status Critical Current

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/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a single-page application performance monitoring method and device and electronic equipment, and relates to the technical field of data processing. The specific implementation scheme of the application is as follows: monitoring a single-page application to obtain the running state of the single-page application; the running state comprises that the single-page application carries out home page loading, the single-page application carries out routing page loading or the single-page application initiates a request; and acquiring the performance data of the single-page application according to the running state. Based on the running state of the single-page application, the performance data is obtained, so that the obtained data can pertinently reflect the performance of the single-page application in different running states, and the accuracy of performance judgment is improved.

Description

Single-page application performance monitoring method and device and electronic equipment
Technical Field
The present application relates to data processing technologies in the field of computer technologies, and in particular, to a method and an apparatus for monitoring performance of a single-page application, and an electronic device.
Background
The user often appears the phenomenon such as card pause or white screen when browsing the page, has seriously influenced user experience, in order to improve user experience that the user browses the page, need to carry out the analysis to the performance of page, then improve page application to the page performance that obtains. However, at present, when performance monitoring is performed on a single-page application, the performance of the single-page application cannot be better reflected by the acquired data, and the performance determination accuracy is poor.
Disclosure of Invention
The embodiment of the application provides a single-page application performance monitoring method and device and electronic equipment, and aims to solve the problems that when the performance of single-page application is monitored, the performance of the single-page application cannot be better reflected by acquired data, and the performance judgment accuracy is poor.
In order to solve the above technical problem, the present application is implemented as follows:
a first aspect of the present application provides a method for monitoring performance of a single-page application, including:
monitoring a single-page application to obtain the running state of the single-page application; the running state comprises that the single-page application carries out home page loading, the single-page application carries out routing page loading or the single-page application initiates a request;
and acquiring the performance data of the single-page application according to the running state.
A second aspect of the present application provides a single-page application performance monitoring apparatus, including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for monitoring a single-page application and acquiring the running state of the single-page application; the running state comprises that the single-page application carries out home page loading, the single-page application carries out routing page loading or the single-page application initiates a request;
and the second acquisition module is used for acquiring the performance data of the single-page application according to the running state.
A third aspect of the present application provides an electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
A fourth aspect of the present application provides a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of the first aspect.
One embodiment in the above application has the following advantages or benefits: monitoring a single-page application to obtain the running state of the single-page application; the running state comprises that the single-page application carries out home page loading, the single-page application carries out routing page loading or the single-page application initiates a request; and acquiring the performance data of the single-page application according to the running state. Based on the running state of the single-page application, the performance data is obtained, so that the obtained data can pertinently reflect the performance of the single-page application in different running states, and the accuracy of performance judgment is improved.
And under the condition that the running state is that the single-page application carries out home page loading, acquiring at least one duration of the home page loading, wherein the performance data comprises the at least one duration, and the at least one duration comprises at least one of a white screen duration, a Domain Name System (DNS) query duration and a static resource loading duration. The performance of the single-page application during the first page loading can be analyzed through the performance data obtained during the first page loading of the single-page application, and the accuracy of performance judgment is improved.
And under the condition that the running state is that the single-page application carries out route page loading, acquiring the loading duration of the route page, wherein the performance data comprises the loading duration of the route page. The performance of the single-page application during the loading of the routing page can be analyzed through the performance data obtained during the loading of the routing page of the single-page application, and the accuracy of judging the performance of the single-page application is improved.
By creating the proxy object, under the condition that the running state is the single-page application initiating request, the performance data of the interface responding to the initiating request is obtained through the proxy object, and the performance data comprises at least one of the interface response time and the returned data size, so that the performance data of the interface responding to the initiating request can be obtained when the single-page application initiating request, the performance of the interface responding to the initiating request of the single-page application can be analyzed, and the accuracy of judging the performance of the single-page application is improved.
Other effects of the above-described alternative will be described below with reference to specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a flowchart of a single-page application performance monitoring method provided in an embodiment of the present application;
FIG. 2 is a block diagram of a single-page application performance monitoring apparatus according to an embodiment of the present disclosure;
fig. 3 is a block diagram of an electronic device for implementing the method for monitoring performance of a single-page application according to the embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. 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 present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Referring to fig. 1, fig. 1 is a flowchart of a single-page application performance monitoring method provided in an embodiment of the present application, and as shown in fig. 1, the embodiment provides a single-page application performance monitoring method applied to an electronic device, including the following steps:
step 101, monitoring a single-page application to acquire the running state of the single-page application; the running state comprises that the single-page application carries out home page loading, the single-page application carries out routing page loading or the single-page application initiates a request.
Specifically, a single-page application refers to an application having only one main page, a browser needs to load all necessary HyperText Markup Language (HTML) texts, js (short for JavaScript) scripts and Cascading Style Sheets (CSS) scripts at first, all page contents are contained in the main page, and when a first page is displayed, the main page is loaded, but when the first page is displayed, only the content of the first page is displayed. The home page is a page which is displayed first when the single-page application is started, and the home page may be a main page or not.
In the single-page application, after the main page is loaded, if page jump is triggered, only local resources are refreshed, and the routing page is a page displayed through page jump after the main page is loaded.
The single-page application initiation request can be understood as a single-page application initiation ajax request, which may be triggered based on the operation of a user or may be automatically triggered by a webpage.
The method comprises the steps that the electronic equipment monitors a single-page application to obtain the running state of the single-page application; the running state comprises that the single-page application carries out home page loading, the single-page application carries out routing page loading or the single-page application initiates a request.
And 102, acquiring the performance data of the single-page application according to the running state.
In the step, the performance data is determined to be acquired based on the running state of the single-page application, the running states are different, and the acquired performance data are different, so that the performance of the single-page application can be analyzed in multiple angles based on the acquired performance data; meanwhile, the performance data can be obtained based on different running states of the single-page application, so that the obtained data can pertinently reflect the performance of the single-page application, and the accuracy of performance judgment is improved.
The electronic device may be a cell phone, a tablet computer, a laptop computer, etc.
In this embodiment, a single-page application is monitored, and the running state of the single-page application is obtained; the running state comprises that the single-page application carries out home page loading, the single-page application carries out routing page loading or the single-page application initiates a request; and acquiring the performance data of the single-page application according to the running state. Based on the running state of the single-page application, the performance data is obtained, so that the obtained data can pertinently reflect the performance of the single-page application in different running states, and the accuracy of performance judgment is improved.
In an embodiment of the present application, acquiring the performance data of the single-page application according to the running state includes:
and under the condition that the running state is that the single-page application carries out home page loading, acquiring at least one duration of the home page loading, wherein the performance data comprises the at least one duration, and the at least one duration comprises at least one of a white screen duration, a Domain Name System (DNS) query duration and a static resource loading duration.
Specifically, the white screen duration may be understood as a duration from a time point of triggering the top page loading to a white screen ending time point, and the white screen ending time point may be a time point at which the browser starts to display the content, for example, a time point at which the browser starts to render a < body > tag of the page or finishes parsing a < head > tag of the page is a time point at which the page white screen ends.
The method includes the steps of counting various time points of home page loading through a performance interface provided by a browser, for example, a starting time point of home page loading, a time point of browser starting to render a < body > tag of a page or completing resolving a < head > tag of the page, a time point of starting to query a Domain Name System (DNS), a time point of finishing querying a DNS, and a starting time point and an ending time point of static resource loading. And then obtaining the white screen duration, the DNS query duration and the static resource loading duration through the obtained time points.
In this embodiment, under the condition that the running state is that the single-page application performs the home page loading, at least one duration of the home page loading is obtained, the performance data includes the at least one duration, and the at least one duration includes at least one of a white screen duration, a domain name system DNS query duration, and a static resource loading duration. The performance of the single-page application during the first page loading can be analyzed through the performance data obtained during the first page loading of the single-page application, and the accuracy of performance judgment is improved.
In an embodiment of the present application, the obtaining performance data of the single-page application according to the running state includes:
and under the condition that the running state is that the single-page application carries out route page loading, acquiring the loading duration of the route page, wherein the performance data comprises the loading duration of the route page.
Specifically, any Document Object Model (Dom) element change on a page of the single-page application triggers a callback function of the mutationobject interface, and based on this, in this embodiment, a body node (body node is a Dom element) of the routing page of the single-page application is monitored, for example, a time length from the occurrence of the change to the end of the change of the body node of the routing page is calculated, and the time length is a loading time length of the routing page.
In this embodiment, when the running state is that the single-page application performs the route page loading, the loading duration of the route page is obtained, and the performance data includes the loading duration of the route page. The performance of the single-page application during the loading of the routing page can be analyzed through the performance data obtained during the loading of the routing page of the single-page application, and the accuracy of judging the performance of the single-page application is improved.
In an embodiment of the application, before the obtaining, according to the running state, the performance data of the single-page application, the method further includes:
creating a proxy object, wherein the method of the proxy object is the same as that of a global object provided by a browser, the single-page application runs on the browser, and the global object is used for acquiring performance data of an interface responding to a single-page application initiation request;
the obtaining performance data of the single-page application according to the running state includes:
and under the condition that the running state is that the single-page application initiates a request, acquiring performance data of an interface responding to the initiation request by the proxy object, wherein the performance data comprises at least one of the response time of the interface and the size of returned data.
In this embodiment, the global object may be an XMLHttpRequest object. And creating a proxy object, wherein the method included by the proxy object is the same as that included by a global object provided by a browser, so that when the running state is that the single-page application initiates a request, the performance data of an interface responding to the initiated request can be acquired through the proxy object.
Specifically, proxy objects are set for XMLHttpRequest (hereinafter referred to as XHR) provided by a browser, and attributes and methods included in the proxy objects are the same as those included in the XHR. The proxy object is used to override the global XHR (i.e., browser-provided XHR). When new XHR () occurs, a proxy object instance is created. When the single-page application initiates an Ajax request, the request is intercepted by methods such as an open method and a send method which are rewritten (namely, the open method and the send method in the proxy object are the same as those in an XMLHttpRequest object provided by a browser), and further detailed performance information of the Ajax interface, such as interface response time, returned data size and the like, is obtained.
In this embodiment, by creating the proxy object, and acquiring, by the proxy object, the performance data of the interface responding to the initiation request when the running state is the single-page application initiation request, where the performance data includes at least one of the interface response time and the size of the returned data, it is possible to acquire the performance data of the interface responding to the initiation request when the single-page application initiation request is made, so that the performance of the interface responding to the initiation request by the single-page application can be analyzed, and the accuracy of determining the performance of the single-page application is improved.
In addition, performance data can be acquired for the running of the program in the single-page application, marks are made at the starting position and the ending position of the program by using a mark method provided by a performance interface, and then the running time of the program is counted by using a measure method when the running of the program is ended.
Referring to fig. 2, fig. 2 is a structural diagram of a single-page application performance monitoring apparatus according to an embodiment of the present application, and as shown in fig. 2, the embodiment provides a single-page application performance monitoring apparatus 200, including:
a first obtaining module 201, configured to monitor a single-page application and obtain an operating state of the single-page application; the running state comprises that the single-page application carries out home page loading, the single-page application carries out routing page loading or the single-page application initiates a request;
a second obtaining module 202, configured to obtain performance data of the single-page application according to the running state.
In an embodiment of the present application, the second obtaining module 202 is configured to:
and under the condition that the running state is that the single-page application carries out home page loading, acquiring at least one duration of the home page loading, wherein the performance data comprises the at least one duration, and the at least one duration comprises at least one of a white screen duration, a Domain Name System (DNS) query duration and a static resource loading duration.
In an embodiment of the present application, the second obtaining module 202 is configured to:
and under the condition that the running state is that the single-page application carries out route page loading, acquiring the loading duration of the route page, wherein the performance data comprises the loading duration of the route page.
In an embodiment of the present application, the single-page application performance monitoring apparatus 200 further includes:
the system comprises a creating module, a processing module and a processing module, wherein the creating module is used for creating a proxy object, the method of the proxy object is the same as that of a global object provided by a browser, the single-page application runs on the browser, and the global object is used for acquiring performance data of an interface responding to a request initiated by the single-page application;
the second obtaining module 202 is configured to:
and under the condition that the running state is that the single-page application initiates a request, acquiring performance data of an interface responding to the initiation request by the proxy object, wherein the performance data comprises at least one of the response time of the interface and the size of returned data.
In an embodiment of the present application, the global object is an XMLHttpRequest object.
The single-page application performance monitoring apparatus 200 can implement each process implemented by the electronic device in the method embodiment shown in fig. 1, and is not described herein again to avoid repetition.
The single-page application performance monitoring device 200 of the embodiment of the application monitors the single-page application to acquire the running state of the single-page application; the running state comprises that the single-page application carries out home page loading, the single-page application carries out routing page loading or the single-page application initiates a request; and acquiring the performance data of the single-page application according to the running state. Based on the running state of the single-page application, the performance data is obtained, so that the obtained data can pertinently reflect the performance of the single-page application in different running states, and the accuracy of performance judgment is improved.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Fig. 3 is a block diagram of an electronic device for monitoring performance of a single-page application according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 3, the electronic apparatus includes: one or more processors 301, memory 302, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 3, one processor 301 is taken as an example.
Memory 302 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the single-page application performance monitoring method provided by the present application. The non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to perform the single-page application performance monitoring method provided by the present application.
The memory 302 is a non-transitory computer readable storage medium, and can be used for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules (e.g., the first obtaining module 201 and the second obtaining module 202 shown in fig. 2) corresponding to the single-page application performance monitoring method in the embodiment of the present application. The processor 301 executes various functional applications of the server and data processing by running non-transitory software programs, instructions and modules stored in the memory 302, that is, implements the single-page application performance monitoring method in the above method embodiment.
The memory 302 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device implementing the single-page application performance monitoring method, and the like. Further, the memory 302 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 302 may optionally include memory located remotely from the processor 301, and these remote memories may be connected over a network to an electronic device implementing the single-page application performance monitoring method. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device implementing the single-page application performance monitoring method may further include: an input device 303 and an output device 304. The processor 301, the memory 302, the input device 303 and the output device 304 may be connected by a bus or other means, and fig. 3 illustrates the connection by a bus as an example.
The input device 303 may receive input numeric or character information and generate key signal inputs related to user settings and function control of an electronic apparatus implementing the single-page application performance monitoring method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input devices. The output devices 304 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a single-page application performance monitoring device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, single-page application is monitored, and the running state of the single-page application is obtained; the running state comprises that the single-page application carries out home page loading, the single-page application carries out routing page loading or the single-page application initiates a request; and acquiring the performance data of the single-page application according to the running state. Based on the running state of the single-page application, the performance data is obtained, so that the obtained data can pertinently reflect the performance of the single-page application in different running states, and the accuracy of performance judgment is improved.
And under the condition that the running state is that the single-page application carries out home page loading, acquiring at least one duration of the home page loading, wherein the performance data comprises the at least one duration, and the at least one duration comprises at least one of a white screen duration, a Domain Name System (DNS) query duration and a static resource loading duration. The performance of the single-page application during the first page loading can be analyzed through the performance data obtained during the first page loading of the single-page application, and the accuracy of performance judgment is improved.
And under the condition that the running state is that the single-page application carries out route page loading, acquiring the loading duration of the route page, wherein the performance data comprises the loading duration of the route page. The performance of the single-page application during the loading of the routing page can be analyzed through the performance data obtained during the loading of the routing page of the single-page application, and the accuracy of judging the performance of the single-page application is improved.
By creating the proxy object, under the condition that the running state is the single-page application initiating request, the performance data of the interface responding to the initiating request is obtained through the proxy object, and the performance data comprises at least one of the interface response time and the returned data size, so that the performance data of the interface responding to the initiating request can be obtained when the single-page application initiating request, the performance of the interface responding to the initiating request of the single-page application can be analyzed, and the accuracy of judging the performance of the single-page application is improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A method for monitoring the performance of a single-page application is characterized by comprising the following steps:
monitoring a single-page application to obtain the running state of the single-page application; the running state comprises that the single-page application carries out home page loading, the single-page application carries out routing page loading or the single-page application initiates a request;
and acquiring the performance data of the single-page application according to the running state.
2. The method for monitoring the performance of the single-page application according to claim 1, wherein the obtaining the performance data of the single-page application according to the running state comprises:
and under the condition that the running state is that the single-page application carries out home page loading, acquiring at least one duration of the home page loading, wherein the performance data comprises the at least one duration, and the at least one duration comprises at least one of a white screen duration, a Domain Name System (DNS) query duration and a static resource loading duration.
3. The method for monitoring the performance of the single-page application according to claim 1, wherein the obtaining the performance data of the single-page application according to the running state comprises:
and under the condition that the running state is that the single-page application carries out route page loading, acquiring the loading duration of the route page, wherein the performance data comprises the loading duration of the route page.
4. The method for monitoring the performance of the single-page application according to claim 1, wherein before the obtaining the performance data of the single-page application according to the running state, the method further comprises:
creating a proxy object, wherein the proxy object comprises a method the same as a method of a global object provided by a browser, the single-page application runs on the browser, the global object is used for acquiring performance data of an interface responding to a single-page application initiation request, and the performance data comprises at least one of response time and return data size of the interface;
the obtaining performance data of the single-page application according to the running state includes:
and under the condition that the running state is that the single-page application initiates a request, acquiring performance data of an interface responding to the initiation request through the proxy object.
5. The single-page application performance monitoring method of claim 4, wherein the global object is an XMLHttpRequest object.
6. A single-page application performance monitoring apparatus, comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for monitoring a single-page application and acquiring the running state of the single-page application; the running state comprises that the single-page application carries out home page loading, the single-page application carries out routing page loading or the single-page application initiates a request;
and the second acquisition module is used for acquiring the performance data of the single-page application according to the running state.
7. The single-page application performance monitoring apparatus according to claim 6, wherein the second obtaining module is configured to:
and under the condition that the running state is that the single-page application carries out home page loading, acquiring at least one duration of the home page loading, wherein the performance data comprises the at least one duration, and the at least one duration comprises at least one of a white screen duration, a Domain Name System (DNS) query duration and a static resource loading duration.
8. The single-page application performance monitoring apparatus according to claim 6, wherein the second obtaining module is configured to:
and under the condition that the running state is that the single-page application carries out route page loading, acquiring the loading duration of the route page, wherein the performance data comprises the loading duration of the route page.
9. The single-page application performance monitoring apparatus of claim 6, further comprising:
a creating module, configured to create a proxy object, where the proxy object includes a method that is the same as a method that a global object provided by a browser includes, where the single-page application runs on the browser, and the global object is used to obtain performance data of an interface responding to a request initiated by the single-page application, where the performance data includes at least one of a response time and a return data size of the interface
The second obtaining module is configured to:
and under the condition that the running state is that the single-page application initiates a request, acquiring performance data of an interface responding to the initiation request through the proxy object.
10. The single-page application performance monitoring apparatus of claim 9, wherein the global object is an XMLHttpRequest object.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
CN202010074083.4A 2020-01-22 2020-01-22 Single-page application performance monitoring method and device and electronic equipment Pending CN111290912A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010074083.4A CN111290912A (en) 2020-01-22 2020-01-22 Single-page application performance monitoring method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010074083.4A CN111290912A (en) 2020-01-22 2020-01-22 Single-page application performance monitoring method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN111290912A true CN111290912A (en) 2020-06-16

Family

ID=71030682

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010074083.4A Pending CN111290912A (en) 2020-01-22 2020-01-22 Single-page application performance monitoring method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111290912A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685269A (en) * 2020-12-21 2021-04-20 北京达佳互联信息技术有限公司 Data acquisition method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102361484A (en) * 2011-07-05 2012-02-22 上海交通大学 Passive network performance measuring system and page identification method thereof
CN106100936A (en) * 2016-08-10 2016-11-09 乐视控股(北京)有限公司 Webpage method for monitoring performance and device and the webserver, client
CN106897215A (en) * 2017-01-20 2017-06-27 华南理工大学 A kind of method gathered based on WebView webpages loading performance and user behavior flow data
CN107239291A (en) * 2017-06-13 2017-10-10 浪潮软件股份有限公司 A kind of method of templated query configuration in Mobile solution
US20180173390A1 (en) * 2016-12-21 2018-06-21 Aon Global Operations Ltd (Singapore Branch) Content Management System Extensions
CN109739725A (en) * 2018-12-29 2019-05-10 云智慧(北京)科技有限公司 Monitoring method, device and system based on browser and storage medium
CN110717121A (en) * 2019-08-27 2020-01-21 北京奇艺世纪科技有限公司 Method and device for determining first screen time of page

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102361484A (en) * 2011-07-05 2012-02-22 上海交通大学 Passive network performance measuring system and page identification method thereof
CN106100936A (en) * 2016-08-10 2016-11-09 乐视控股(北京)有限公司 Webpage method for monitoring performance and device and the webserver, client
US20180173390A1 (en) * 2016-12-21 2018-06-21 Aon Global Operations Ltd (Singapore Branch) Content Management System Extensions
CN106897215A (en) * 2017-01-20 2017-06-27 华南理工大学 A kind of method gathered based on WebView webpages loading performance and user behavior flow data
CN107239291A (en) * 2017-06-13 2017-10-10 浪潮软件股份有限公司 A kind of method of templated query configuration in Mobile solution
CN109739725A (en) * 2018-12-29 2019-05-10 云智慧(北京)科技有限公司 Monitoring method, device and system based on browser and storage medium
CN110717121A (en) * 2019-08-27 2020-01-21 北京奇艺世纪科技有限公司 Method and device for determining first screen time of page

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄丽琼 等: "基于Angular的单页面应用设计与实现", 《基金项目》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685269A (en) * 2020-12-21 2021-04-20 北京达佳互联信息技术有限公司 Data acquisition method and device, electronic equipment and storage medium
WO2022134875A1 (en) * 2020-12-21 2022-06-30 北京达佳互联信息技术有限公司 Data acquisition method and electronic device

Similar Documents

Publication Publication Date Title
US11144711B2 (en) Webpage rendering method, device, electronic apparatus and storage medium
EP3518124A1 (en) Webpage rendering method and related device
CN110717121B (en) Method and device for determining first screen time of page
CN111158799A (en) Page rendering method and device, electronic equipment and storage medium
CN113159807B (en) Floor page processing method, floor page processing device, floor page processing equipment and floor page processing medium
CN111737399A (en) Method and device for expanding question and answer set, electronic equipment and readable storage medium
US11930096B2 (en) Systems and methods for rendering interactive web pages
CN110992112A (en) Method and device for processing advertisement information
US20160004676A1 (en) Displaying web pages
US20240095298A1 (en) Systems and methods for rendering interactive web pages
CN114741149A (en) Page switching method and device for single-page application, storage medium and electronic equipment
CN111290912A (en) Single-page application performance monitoring method and device and electronic equipment
CN113158098B (en) Page generation method, device, equipment and medium
US10095791B2 (en) Information search method and apparatus
CN111125597A (en) Webpage loading method, browser, electronic equipment and storage medium
CN111522599B (en) Method and device for transmitting information
CN110622135B (en) System and method for providing content items in situations involving suboptimal network conditions
CN112800319A (en) Information searching method, device, equipment and medium
CN111857488B (en) Method and device for popping up menu in applet, electronic equipment and storage medium
CN112269954B (en) Page use time length determining method and device
CN114020992B (en) Page blocking method, device, system, client and storage medium
US10460005B2 (en) Data consumption between heterogeneous web applications
CN113761404A (en) Page access method, server, terminal equipment, system and electronic equipment
CN115344801A (en) Method, device, equipment and medium for updating webpage link
CN114065077A (en) Webpage display method and device, electronic equipment and 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200616