首页 > 其他分享 >mac 下利用 xdebug生成性能报告

mac 下利用 xdebug生成性能报告

时间:2023-06-13 15:09:42浏览次数:39  
标签:xdebug remote 性能 profiler mac enable 子函数 生成


1、安装 xdebug


[xdebug]
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_connect_back=0
xdebug.remote_host=0.0.0.0
xdebug.remote_port=9001
xdebug.idekey=PHPSTORM
xdebug.remote_autostart=0
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=1
xdebug.profiler_enable_trigger_value=666
xdebug.profiler_output_dir=/Users/apple/profile

其中关于性能报告的几项配置:
profiler_enable 为 0 关闭自动生成性能报告
profiler_enable_trigger 为 1 开启触发生成性能报告
profiler_enable_trigger_value 触发性能报告的 “密钥”,传输时会触发xdebug
profiler_output_dir 性能报告文件目录

注意,这里的 profiler_output_dir 目录的权限一定要给够

sudo chmod 777 /Users/apple/profile

2、触发性能分析

2.1 chrome 浏览器

安装 Xdebug Helper,安装完成,右击该扩展->选择 选项 -> 配置 Profile Trigger Value->保存,这个值就是上面的密 666。安装该扩展需要翻墙。也可自行百度下载该扩展去安装。

在网页中点开扩展,选择 profile 模式,就会触发

mac 下利用 xdebug生成性能报告_性能分析

2.2 postman

GET / POST / COOKIE 变量中传一个 XDEBUG_PROFILE=${TRIGGER_VALUE}
即传输一个参数 XDEBUG_PROFILE=666

3、查看性能分析报告

先安装工具

$ brew install graphviz
$ brew install qcachegrind

进入设置的生成的报告路径目录下,输入命令 qcachegrind

➜  profiler cd /Users/apple/profiler
➜  profiler qcachegrind

File->Open->all files->选中文件->open

mac 下利用 xdebug生成性能报告_性能分析_02

mac 下利用 xdebug生成性能报告_性能分析_03


mac 下利用 xdebug生成性能报告_运行时间_04


图片参数占比

funciton name : 函数名
calls: 调用次数
Incl. Wall Time (microsec): 函数运行时间(包括子函数)
IWall%:函数运行时间(包括子函数)占比
Excl. Wall Time (microsec):函数运行时间(不包括子函数)
EWall%:函数运行时间(不包括子函数)


标签:xdebug,remote,性能,profiler,mac,enable,子函数,生成
From: https://blog.51cto.com/u_16159391/6470196

相关文章

  • window下正常的springboot到mac下运行却报错
    Errorcreatingbeanwithname'defaultValidator'definedinclasspathresource[org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]:Invocationofinitmethodfailed;nestedexceptionisjava.lang.NoClassDefFoun......
  • mac 下Golang 安装Protobuf
    1、安装protobufbrewinstallprotobuf2、检查安装结果protoc--version3、安装golangforprotobuf插件gogetgithub.com/golang/protobuf/protoc-gen-gogoget-u-vgithub.com/golang/protobuf/protoc-gen-gogoget=gitclone+goinstall这里会慢的要死所以我这里采取......
  • Mac软件安装
    文章目录一、NavicatPremium12Mac安装二、Mac将Wps本地文件备份到云端三、Mac安装Xmind8四、安装SublimeText1、[官网地址:](http://www.sublimetext.com/)2、下载中文插件五、安装SecureCRT六、安装BeyondCompare七、图片缩小大小一、NavicatPremium12Mac安装NavicatP......
  • 画板生成海报图
    画板生成海报图<canvasid="myCanvas"canvas-id="myCanvas"style="width:320px;height:520px"@longpress="saveTheQrCode(goods_poster)"></canvas>网络生成的图片需要使用promose进行一下异步处理这样可以方式因为异步问题造成海报无法生成 getImageInfo(i......
  • 如何使用Stable Diffusion生成艺术二维码?
    硬件准备物理内存:至少16G(8G直接安装阶段就卡死)N卡:此处我使用GTX16606G(2019年双12购买)操作系统windows11软件准备网络要通畅git:https://git-scm.com/download/winPython:https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exeCUDA驱动:https://develo......
  • JMeter在Mac下的安装
    其实不论操作系统是Windows、Unix(如MacOS)、Linux(如Ubuntu)等,JMeter所需要的基础环境配置都是类似的,本文介绍JMeterforMAC的安装与环境配置。JMeter安装步骤如下:安装JDK安装JMeter1、选择版本截止2018年10月,JMeter的最新版本是5.0,JMeter5.0需要Java8、Java9,所以我们最终......
  • mac M2 装PHP xdebug
    目前xdebug你不支持arm只能自编译pecel安装是arm64arch-arm64sudopeclinstallxdebug编译下载https://xdebug.org/download编译gitclonehttps://github.com/xdebug/xdebug.gitcdxdebugphpize./configure--enable-xdebug--host=arm-linux-gnueabimak......
  • GoodNotes 5(mac手写笔记软件)
    GoodNotes5mac版是一款非常好用的手写笔记软件,GoodNotes5将会支持使用苹果系统的Mac电脑进行手写,并提供多种不同的笔刷来对字体进行书写。GoodNotes5这款软件采用了非常符合Mac用户习惯的界面,其手写风格和功能完全可以满足日常的记录需求。GoodNotes5在书写方面非常流畅,......
  • JAVA非递归生成无限级菜单树的较简代码实现。(非泛用型工具包,仅总结逻辑)
    这是一个根据列表生成一个树状结构的较简单实现。搜了搜看起来好像没多少人总结过这种实现。写上来整理一下自己的思路,请大家用用看看,应该用起来问题不大?反正我没遇到BUG。实现的时间复杂度为O(N),空间复杂度应该还是O(N)吧。不过GPT说O(1)可能是因为java的对象实现hash链表是引用而不是......
  • mybaits-plugs 连接orcale自动生成
    mybaits-plugs连接orcale自动生成calorca  20200516shmybatis-plugs是对mybatis框架进一步封装,今天尝试使用mybatis-plugs的逆向工程连接orcale/mysql数据库生成实体类以及dao1、遇到的问题有连接数据的时候抱错,拒绝连接一定要仔细检查orcalsid服务id是否正......