Skip to content
Jason M edited this page Jun 9, 2017 · 2 revisions

Synopsis

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.

ON_STATS Event

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.

SIGUSR1 Signal

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.

Clone this wiki locally