stream / junkman
PHP运行环境代码段实时监控,GC日志收集分析
dev-master
2019-06-17 04:07 UTC
Requires
- php: >=7.0
This package is auto-updated.
Last update: 2024-09-17 15:30:01 UTC
README
关于JunkMan
JunkMan 是一个工具集,通过 xdebug 追踪 PHP 的 GC。并将其分发到 JunkMonitor,以便您能够及时监控应用程序的 GC 日志。
1. 构建
composer require stream/junkman
2. 启动 JunkManTransfer 服务
Windows
start /B (YOUR_PATH)vendor/stream/junkman/src/JunkManTransfer.exe
Linux
(YOUR_PATH)vendor/stream/junkman/src/JunkManTransfer &
tips: chmod -R 0777 (YOUR_PATH)vendor/stream/junkman/
3. 设置您的据点
stream 监控(监控代码块)
JunkMan::stream()->start('stream watching');
#code
JunkMan::stream()->end();
洪水监控(用于长时间运行的应用程序进程)
JunkMan::flood()->start('flood watching');
while(true){
#code
#if ... break
#flush the message to monitor
JunkMan::flood()->flush();
}
JunkMan::flood()->end();
点(监控变量)
$data = 'some message';
JunkMan::spot()->dot('spot watching',$data);
4. 下载 JunkMonitor
tips:
the remote server should open firewall to enable port of 9303,
that you could connect the server by JunkMonitor
command:
firewall-cmd --zone=public --add-port=9303/tcp --permanent
firewall-cmd --reload