Skip to content
PHP Extension used by Hoard Applications for low-level system interaction
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
hoardutils
.gitignore
Makefile
README.md
config.json

README.md

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.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]
You can’t perform that action at this time.