Skip to content
PHP Library for New Relic Agent
PHP
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.
src
tests/src
.gitattributes
.gitignore
.php_cs
.scrutinizer.yml
.travis.yml
CONTRIBUTING.md
LICENSE
README.md
composer.json
phpunit.xml.dist

README.md

PHP NewRelic

Source Code Packagist Version Build Status Coverage Status Quality Score SensioLabs Insight Software License Total Downloads

OOP Wrapper for NewRelic's PHP Agent.

Installation

To install, use composer:

composer require SobanVuex/php-newrelic:~2.0

Usage

Use the Agent directly or with your own DI with \SobanVuex\NewRelic\Agent.

Examples

Setting the application name

$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']);

Mark a transaction as a background job

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

Name a transaction

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

Testing

$ ./vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

You can’t perform that action at this time.