refinery29 / newrelic
Provides a wrapper around the NewRelic agent
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 75 071
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 21
Forks: 0
Open Issues: 0
Requires
- php: ^5.6 || ^7.0
- beberlei/assert: ^2.5.0
Requires (Dev)
- codeclimate/php-test-reporter: 0.4.2
- phpunit/phpunit: ^5.7.7
- refinery29/php-cs-fixer-config: 0.6.9
- refinery29/test-util: 0.10.2
This package is not auto-updated.
Last update: 2024-06-05 23:15:11 UTC
README
This repository provides a wrapper around the New Relic PHP API,
inspired by intouch/newrelic
.
Installation
Run
$ composer require refinery29/newrelic
Usage
use Refinery29\NewRelic\Agent; $agent = new Agent(); $agent->setAppname('Refinery29 API'); $agent->nameTransaction('POST /entries');
💡 Ideally, you should create one instance of Refinery29\NewRelic\Agent
, share it using a container,
and inject it as a dependency into objects wishing to consume it.
Handlers
If you don't inject a handler, Refinery29\NewRelic\Agent
creates an instance of Refinery29\NewRelic\Handler\DefaultHandler
and uses it to make calls to the New Relic API.
You may want to inject a NullHandler
if you don't want to actually make calls to the New Relic API, for example,
in non-production environments:
use Refinery29\NewRelic\Agent; use Refinery29\NewRelic\Handler; $handler = new Handler\NullHandler(); $agent = new Agent($handler); $agent->setAppname('Refinery29 API'); $agent->nameTransaction('POST /entries');
Contributing
Please have a look at CONTRIBUTING.md
.
Code of Conduct
Please have a look at CONDUCT.md
.
License
This package is licensed using the MIT License.