-
Notifications
You must be signed in to change notification settings - Fork 15
Stats
Jason M edited this page Jun 9, 2017
·
2 revisions
The Daemon class has a built in mechanism to collect and show run time statistics for your daemon application. Calling Daemon::stats()
will return an array of current stats, such as what user the daemon is running as. Memory foot print. System Load. What events have fired. What plugins are loaded and their own custom stats.
You can set a listener on the DaemonEvent::ON_STATS event and modify the stats that are returned when Daemon::stats()
is called. Plugins use this to add their own stats.
The Daemon (parent process only) will automatically catch the SIGUSR1
signal and dump all stats to the log file (and console if you're not daemonized). Daemon::$dumpOnSignal
must be true
for the signal to be caught. By default it's true
.