PHP code example of instrumental / instrumental_agent
1. Go to this page and download the library: Download instrumental/instrumental_agent 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/ */
instrumental / instrumental_agent example snippets
$I = new \Instrumental\Agent();
$I->setApiKey("PROJECT_API_TOKEN");
$I->setEnabled($isProduction); // only send metrics in production
$I->gauge('load', 1.23); # value at a point in time
$I->increment('signups'); # increasing value, think "events"
$post = $I->time('query_time', function(){ # time a block of code
return Post->find(1);
});
$post = $I->time_ms('query_time_in_ms', function(){ # prefer milliseconds?
return Post->find(1);
});
$I->notice('Jeffy deployed rev ef3d6a'); # instantaneous event
$I->notice('Testing socket buffer increase', time() - (3*24*60*60), 20*60); # an event (three days ago) with a duration (20 minutes)
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.