This PHP extension can be used in conjunction with Hoard applications to collect low level system information.
Zephir is required to build this extension. You can find the installation instructions here.
git clone [email protected]:marcqualie/hoard-utils.git
cd hoard-utils
make && sudo make install
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.com
Get some load metrics
$metrics->getLoad();
// [1.0, 1.5, 2.0]
Get CPU count
$metrics->getCpuCount();
// 4
Get 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]