PHP code example of burak-vademecum / php-newrelic

1. Go to this page and download the library: Download burak-vademecum/php-newrelic 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/ */

    

burak-vademecum / php-newrelic example snippets


$newrelic = new SobanVuex\NewRelic\Agent('MyApp');
// or
$newrelic = new SobanVuex\NewRelic\Agent('MyApp1;MyApp2');
// or
$newrelic = new SobanVuex\NewRelic\Agent(['MyApp1', 'MyApp2']);

$newrelic = new SobanVuex\NewRelic\Agent();
$newrelic->setAppname('MyApp');
// or
$newrelic->setAppname('MyApp1;MyApp2');
// or
$newrelic->setAppname(['MyApp1', 'MyApp2']);

$newrelic = new SobanVuex\NewRelic\Agent();
$newrelic->backgroundJob();
// or
$newrelic->backgroundJob(PHP_SAPI == 'cli');

$newrelic = new SobanVuex\NewRelic\Agent();
$newrelic->nameTransaction('myController/myAction');

composer