CN112596994A - XHProf-based PHP program performance detection method and device - Google Patents

XHProf-based PHP program performance detection method and device Download PDF

Info

Publication number
CN112596994A
CN112596994A CN202011561657.7A CN202011561657A CN112596994A CN 112596994 A CN112596994 A CN 112596994A CN 202011561657 A CN202011561657 A CN 202011561657A CN 112596994 A CN112596994 A CN 112596994A
Authority
CN
China
Prior art keywords
xhprof
php program
php
prometous
performance detection
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
CN202011561657.7A
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.)
Fuzhou Zhangzhong Cloud Technology Co ltd
Original Assignee
Fuzhou Zhangzhong Cloud 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 Fuzhou Zhangzhong Cloud Technology Co ltd filed Critical Fuzhou Zhangzhong Cloud Technology Co ltd
Priority to CN202011561657.7A priority Critical patent/CN112596994A/en
Publication of CN112596994A publication Critical patent/CN112596994A/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/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
    • 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/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/323Visualisation of programs or trace data
    • 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/3452Performance evaluation by statistical analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/865Monitoring of software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Debugging And Monitoring (AREA)

Abstract

According to the method and the device for detecting the performance of the PHP program based on the XHProf, provided by the invention, the analysis result of the XHProf is written into the log file; outputting the log file to Prometous for storage; and creating a chart in Grafana, and performing performance detection of a PHP program on data stored in Prometous, so that time consumption and call quantity distribution statistics of function call can be visually checked conveniently, and system performance bottlenecks can be quickly positioned and found.

Description

XHProf-based PHP program performance detection method and device
Technical Field
The invention relates to the technical field of computers, in particular to a PHP program performance detection method and device based on XHProf.
Background
PHP (hypertext preprocessor) is a general open source scripting language. At present, PHP is mainly applicable to the field of Web development.
XHProf is a performance analysis tool under PHP, and the open source community has a corresponding GUI tool xhgui for displaying analysis results of XHProf, but xhgui lacks distribution statistics, cannot visually check function call time consumption and call volume distribution statistics, and cannot quickly locate and discover system performance bottlenecks.
Therefore, a method and a device for detecting the performance of the XHProf-based PHP program are needed, which can visually check the time consumption of function call and the distribution statistics of call volume, and quickly locate and find the performance bottleneck of the system.
Disclosure of Invention
Technical problem to be solved
In order to solve the above problems in the prior art, the XHProf-based PHP program performance detection method and apparatus provided by the present invention can visually check the function call time consumption and call volume distribution statistics, and quickly locate and find the system performance bottleneck.
(II) technical scheme
In order to achieve the purpose, the invention adopts a technical scheme that:
the method for detecting the performance of the PHP program based on the XHProf comprises the following steps:
s1, writing the analysis result of the XHProf into a log file;
s2, outputting the log file to Prometous for storage;
s3, creating a chart in Grafana, and carrying out performance detection of the PHP program on the data stored in Prometous.
In order to achieve the purpose, the invention adopts another technical scheme as follows:
apparatus for XHProf-based PHP program performance detection, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of:
s1, writing the analysis result of the XHProf into a log file;
s2, outputting the log file to Prometous for storage;
s3, creating a chart in Grafana, and carrying out performance detection of the PHP program on the data stored in Prometous.
(III) advantageous effects
The invention has the beneficial effects that: writing analysis results of XHProf into a log file; outputting the log file to Prometous for storage; and creating a chart in Grafana, and performing performance detection of a PHP program on data stored in Prometous, so that time consumption and call quantity distribution statistics of function call can be visually checked conveniently, and system performance bottlenecks can be quickly positioned and found.
Drawings
FIG. 1 is a flowchart of a method for PHP program performance detection based on XHProf according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating an overall structure of an apparatus for performance testing of a PHP program based on XHProf according to an embodiment of the present invention.
[ description of reference ]
1: means for XHProf-based PHP program performance detection;
2: a memory;
3: a processor.
Detailed Description
For the purpose of better explaining the present invention and to facilitate understanding, the present invention will be described in detail by way of specific embodiments with reference to the accompanying drawings.
Example one
Referring to fig. 1, a method for detecting PHP program performance based on XHProf includes the steps of:
s1, writing the analysis result of the XHProf into a log file;
the analysis result comprises the calling time, the calling time consumption and the calling times of the PHP program, and the specific format is 'time stamp called function calling time consumption calling times'.
S2, outputting the log file to Prometous for storage;
step S2 specifically includes:
and outputting the log file to Prometous through an Mtail for storage.
S3, creating a chart in Grafana, and carrying out performance detection of the PHP program on the data stored in Prometous.
Step S3 specifically includes:
graphs were created in Grafana and the PHP program performance tests were performed on the data stored in Prometheus by PromQL.
Example two
Referring to fig. 2, the apparatus 1 for XHProf-based PHP program performance detection includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3, wherein the processor 3 implements the steps of the first embodiment when executing the program.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (8)

1. The method for detecting the performance of the PHP program based on the XHProf is characterized by comprising the following steps:
s1, writing the analysis result of the XHProf into a log file;
s2, outputting the log file to Prometous for storage;
s3, creating a chart in Grafana, and carrying out performance detection of the PHP program on the data stored in Prometous.
2. The XHProf-based PHP program performance testing method of claim 1, wherein the analysis result comprises a PHP program calling time, a PHP program calling time duration, and a PHP program calling number.
3. The method for XHProf-based PHP program performance detection as claimed in claim 1, wherein the step S2 is specifically:
and outputting the log file to Prometous through an Mtail for storage.
4. The method for XHProf-based PHP program performance detection as claimed in claim 1, wherein the step S3 is specifically:
graphs were created in Grafana and the PHP program performance tests were performed on the data stored in Prometheus by PromQL.
5. Apparatus for XHProf-based PHP program performance detection, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of:
s1, writing the analysis result of the XHProf into a log file;
s2, outputting the log file to Prometous for storage;
s3, creating a chart in Grafana, and carrying out performance detection of the PHP program on the data stored in Prometous.
6. The apparatus for XHProf-based performance testing of a PHP program according to claim 5, wherein the analysis result comprises a call time, a call duration, and a call number of the PHP program.
7. The apparatus for XHProf-based PHP program performance detection as claimed in claim 5, wherein the step S2 is specifically to:
and outputting the log file to Prometous through an Mtail for storage.
8. The apparatus for XHProf-based PHP program performance detection as claimed in claim 5, wherein the step S3 is specifically to:
graphs were created in Grafana and the PHP program performance tests were performed on the data stored in Prometheus by PromQL.
CN202011561657.7A 2020-12-25 2020-12-25 XHProf-based PHP program performance detection method and device Pending CN112596994A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011561657.7A CN112596994A (en) 2020-12-25 2020-12-25 XHProf-based PHP program performance detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011561657.7A CN112596994A (en) 2020-12-25 2020-12-25 XHProf-based PHP program performance detection method and device

Publications (1)

Publication Number Publication Date
CN112596994A true CN112596994A (en) 2021-04-02

Family

ID=75202459

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011561657.7A Pending CN112596994A (en) 2020-12-25 2020-12-25 XHProf-based PHP program performance detection method and device

Country Status (1)

Country Link
CN (1) CN112596994A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105022822A (en) * 2015-07-17 2015-11-04 成都视达科信息技术有限公司 PHP (Professional Hypertext Preprocessor) based log collection and storage method and system
US20160034326A1 (en) * 2014-07-31 2016-02-04 AppDynamics, Inc. Monitoring a business transaction utilizing php engines
CN105335280A (en) * 2014-07-16 2016-02-17 北京奇虎科技有限公司 Program performance test method and device
CN111581060A (en) * 2020-05-11 2020-08-25 金蝶软件(中国)有限公司 Prometheus-based log alarm system and method and related equipment
CN111897727A (en) * 2020-07-30 2020-11-06 平安科技(深圳)有限公司 Software testing method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335280A (en) * 2014-07-16 2016-02-17 北京奇虎科技有限公司 Program performance test method and device
US20160034326A1 (en) * 2014-07-31 2016-02-04 AppDynamics, Inc. Monitoring a business transaction utilizing php engines
CN105022822A (en) * 2015-07-17 2015-11-04 成都视达科信息技术有限公司 PHP (Professional Hypertext Preprocessor) based log collection and storage method and system
CN111581060A (en) * 2020-05-11 2020-08-25 金蝶软件(中国)有限公司 Prometheus-based log alarm system and method and related equipment
CN111897727A (en) * 2020-07-30 2020-11-06 平安科技(深圳)有限公司 Software testing method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US8924912B2 (en) Method of recording and replaying call frames for a test bench
US8561033B2 (en) Selective branch-triggered trace generation apparatus and method
CN106326104B (en) Terminal control testing method and device
CN107506300B (en) User interface testing method, device, server and storage medium
US9003235B2 (en) Indicating coverage of web application testing
CN103049371A (en) Testing method and testing device of Android application programs
JP6867066B1 (en) Memory analysis methods and equipment based on dynamic stain analysis
US9459991B2 (en) Heap dump object identification in a heap dump analysis tool
CN110741354A (en) Presenting differences between code entity invocations
CN111209185B (en) Keyword-based automated testing method and computer-readable storage medium
CN110908915B (en) Test coverage rate display method and device and computer system
TW201502985A (en) Method and device for processing file
CN107704376B (en) Game automation testing method and system
CN105677569B (en) Android automated test tools and method of testing based on event handler
CN104750602B (en) A kind of dynamic stain data analysing method and device
CN112596994A (en) XHProf-based PHP program performance detection method and device
CN110691005A (en) Website monitoring system and method
CN112861138A (en) Software security analysis method and analysis device, electronic device, and storage medium
CN115562989A (en) Automatic test sequence conversion method, system, equipment and medium
CN113360373A (en) Test method for full traversal of Activity page of mobile application
CN109901983B (en) Automatic testing method and device, storage medium and electronic equipment
CN108304294B (en) Real-time frame number monitoring method, storage medium, equipment and system for IOS application
CN111338956A (en) Automatic pressure measurement method, device, equipment and storage medium
CN110516191A (en) Webpage data is converted into the method and apparatus of picture file
CN110737515B (en) Processing method of data task instruction, computer 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: 20210402

RJ01 Rejection of invention patent application after publication