Home >Backend Development >PHP Tutorial >A docker image for viewing xhprof data files

A docker image for viewing xhprof data files

藏色散人
藏色散人forward
2020-12-17 09:00:503733browse

Recommendation: "PHP Video Tutorial"

xhprof This tool is a tool for analyzing PHP execution. The specific usage method is not explained here. The analysis result package generated by xhprof often needs to be paired with nginx graphviz, and related files need to be configured in the specified path. But when using Windows or Mac, I often don’t want to go through the trouble of setting up a rarely used thing and configuring it just to read a report, so I have always planned to make a mirror, just start it directly and drag the data package in when using it. After intermittent testing, I finally got it here and share it with those who need it:

docker pull 1000172/xhprof_graphviz:v1

The following is a usage example:

  • You can specify the port to start the container
    docker run --name tn -p 8888:80 -d 1000172/xhprof_graphviz:v1
  • Enter the folder where the xhprof data package is generated and copy the file to the location specified by docker
    [MacBook:var root$] cd xhprof/[MacBook:xhprof root$] ls5fd97077636fb.api_demo.xhprof    5fd9708466af4.api_demo.xhprof
    //主要是下面这步[MacBook:xhprof root$] docker cp 5fd9708466af4.api_demo.xhprof tn:/usr/share/nginx/data
    . Open the browser and enter: localhost:8888/xhprof_html/
    You can see it

    Click the link to enter
    You can see it Go to the analysis report. Because the drawing tool is already installed in the image, you can click directly to view the analysis flow chart.
    If there are other good analysis tools that need to be packaged and embedded with a welcome message, I will test them and type them in before sharing them when I have time

The above is the detailed content of A docker image for viewing xhprof data files. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete