xhprof-collector
Sigle XHProfcollector use XHProf API.
Noticethatthisisacollectoroly,soyouhavetogetaguitoshowcollecteddatasuchas xhgui.
Testedphpversio5.6.36
7.0.30
Notice:IfyouareruigphpuderKuberetes,youhavetousetideways_xhprofextesiowhicholysupportphp>=7.0toavoidXHProfcrashihp_execute_iteral.
RequireXHProfextesio(either)uprofiler
tideways
tideways_xhprof(recommed)
xhprof
mogoextesio(either)mogodb(recommed)
mogo
SymfoyItegratioExampleIclude(either)Composer(recommed)
{ "require" : { "zoa-chou/xhprof-collector": "*", }}Siglefile
Copyxhprof-collector/src/collector.phptoyourpath
Requirecollectortoyourprojectatfirstlie,suchas:
<?phprequire_oce '/path/to/your/collector.php';Ngixcofigure
Copyxhprof-collector/src/collector.phptoyourpath
Addfastcgi_paramtoyourgixcofigisideserverblock,suchas:
locatio ~ .*\.php?$ { fastcgi_param PHP_VALUE "auto_preped_file=/path/to/your/collector.php"; fastcgi_pass 127.0.0.1:9000; fastcgi_idex idex.php; iclude fcgi.cof;}Notice:Oceyouvisitedthehostwhichservercofigurecollector,gixwillalwayssedfastcgi_paramtophp-fpmeveifyouvisitotherotcofigureserver.
Appedphp.ii
Copyxhprof-collector/src/collector.phptoyourpath
Addauto_preped_filetoyourphp.ii,suchas:
auto_preped_file=/path/to/your/collector.phpCofigureevirometvariablesXHGUI_ENABLE_PROB——Theprobabilityofstartcollectorwhilerequest.Validvalueisbetwee0(off)ad100(allo),defaultis0.
XHGUI_MONGO_URI——mogodburi,suchas:mogodb://userame:password@ip:host,ip2:host2/dbame?coectTimeoutMS=200
XHGUI_ENABLE_CLI——Eablecollectorwhilephpruigasclimodel.Validvaluesis0(off)ad1(o),defaultis0.
XHGUI_SINGLE_CONTROL——EableusehttpheaderXHGUI-ENABLE-PROB(justlikeXHGUI_ENABLE_PROB,suchas:'XHGUI-ENABLE-PROB:100')tocotroltheprobabilityofstartcollectorwhichwillcoverXHGUI_ENABLE_PROB.Validvaluesis0(off)ad1(o),defaultis0.










评论