Hoard Utils
This PHP extension can be used in conjunction with Hoard applications to collect low level system information.
Dependencies
Zephir is required to build this extension. You can find the installation instructions here.
Installation
git clone https://github.com/marcqualie/hoard-utils.git
cd hoard-utils
make && sudo make install
Examples
Get an instance of the ServerMetrics class
$metrics = new HoardUtils\ServerMetrics;You can use the following commands to access various server metrics.
Get the host name
$metrics->getHostName();
// demo1.hoardhq.comGet some load metrics
$metrics->getLoad();
// [1.0, 1.5, 2.0]Get CPU count
$metrics->getCpuCount();
// 4Get memory information
$metrics->getMemoryInfo();
// ['total' => 8192, 'used' => 4096, 'free' => 4096]Get system process information
$metrics->getProcessInfo();
// ['total' => 512, 'running' => 32, 'stuck' => 1, 'sleeping' => 8, 'threads' => 1024]