stream/junkman

php运行环境代码段实时监控,gc日志收集分析

dev-master 2019-06-17 04:07 UTC

This package is auto-updated.

Last update: 2024-09-17 15:30:01 UTC


README

About JunkMan

JunkMan is a toolkit for what it can trace the PHP GC by xdebug. And distribute its to the JunkMonitor. so that you could monitor the applicaton working GC logs in time.

1. build

composer require stream/junkman   

2. startup JunkManTransfer service

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. set your outpost

stream monitor (monitor code blocks)
JunkMan::stream()->start('stream watching');
#code
JunkMan::stream()->end();
flood monitor (for long time application process)
JunkMan::flood()->start('flood watching');

while(true){
  #code
  #if ... break
  #flush the message to monitor
  JunkMan::flood()->flush();
}

JunkMan::flood()->end();   
spot (monitor a variable)
$data = 'some message';
JunkMan::spot()->dot('spot watching',$data); 

4. Download JunkMonitor

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