PHP code example of lmammino / cube-bundle

1. Go to this page and download the library: Download lmammino/cube-bundle 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/ */

    

lmammino / cube-bundle example snippets


#Inside a controller action

$client = $this->get('cube_client');

$events = $client->metricGet(array(
    'expression' => 'sum(cube_request)',
    'step' => \Cube\Client::INT_ONE_MINUTE,
    'limit' => 100,
));

foreach ($event in $events) {
    echo "There were {$event['value']} hits during {$event['time']} \n";
}