xhprof-collector XHProf 收集器开源项目

我要开发同款
匿名用户2018年12月21日
26阅读
开发技术PHP
所属分类开发工具、PHP开发工具
授权协议GPL

作品详情

xhprof-collector

Single XHProfcollector use XHProf API.

Noticethatthisisacollectoronly,soyouhavetogetaguitoshowcollecteddatasuchas xhgui.

Testedphpversion

5.6.36

7.0.30

Notice:IfyouarerunningphpunderKubernetes,youhavetousetideways_xhprofextensionwhichonlysupportphp>=7.0toavoidXHProfcrashinhp_execute_internal.

RequireXHProfextension(either)

uprofiler

tideways

tideways_xhprof(recommend)

xhprof

mongoextension(either)

mongodb(recommend)

mongo

SymfonyIntegrationExampleInclude(either)

Composer(recommend)

{  "require" : {    "zoa-chou/xhprof-collector": "*",  }}

Singlefile

Copyxhprof-collector/src/collector.phptoyourpath

Requirecollectortoyourprojectatfirstline,suchas:

<?phprequire_once '/path/to/your/collector.php';

Nginxconfigure

Copyxhprof-collector/src/collector.phptoyourpath

Addfastcgi_paramtoyournginxconfiginsideserverblock,suchas:

location ~ .*\.php?$ {    fastcgi_param PHP_VALUE "auto_prepend_file=/path/to/your/collector.php";    fastcgi_pass  127.0.0.1:9000;    fastcgi_index index.php;    include fcgi.conf;}

Notice:Onceyouvisitedthehostwhichserverconfigurecollector,nginxwillalwayssendfastcgi_paramtophp-fpmevenifyouvisitothernotconfigureserver.

Appendphp.ini

Copyxhprof-collector/src/collector.phptoyourpath

Addauto_prepend_filetoyourphp.ini,suchas:

auto_prepend_file=/path/to/your/collector.phpConfigureenvironmentvariables

XHGUI_ENABLE_PROB&mdash;&mdash;Theprobabilityofstartcollectorwhilerequest.Validvalueisbetween0(off)and100(allon),defaultis0.

XHGUI_MONGO_URI&mdash;&mdash;mongodburi,suchas:mongodb://username:password@ip:host,ip2:host2/dbname?connectTimeoutMS=200

XHGUI_ENABLE_CLI&mdash;&mdash;Enablecollectorwhilephprunningasclimodel.Validvaluesis0(off)and1(on),defaultis0.

XHGUI_SINGLE_CONTROL&mdash;&mdash;EnableusehttpheaderXHGUI-ENABLE-PROB(justlikeXHGUI_ENABLE_PROB,suchas:'XHGUI-ENABLE-PROB:100')tocontroltheprobabilityofstartcollectorwhichwillcoverXHGUI_ENABLE_PROB.Validvaluesis0(off)and1(on),defaultis0.

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论