1. Go to this page and download the library: Download showclix/cube-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
showclix / cube-php example snippets
// Create a Client pointed at a local collector and evaluator
$client = \Cube\Client::createHttpClient(array(
'collector' => array(
'host' => 'localhost',
'port' => 1080,
),
'evaluator' => array(
'host' => 'localhost',
'port' => 1081,
),
'secure' => true,
));
$res = $client->metricGet(array(
'expression' => 'sum(cube_request)',
'step' => \Cube\Client::INT_ONE_MINUTE,
'limit' => 100,
));
echo "There were {$res[0]['value']} hits during {$res[0]['time']}";