composer require damejidlo/newrelic
Register NewRelicExtension
in your config:
extensions:
newrelic: Damejidlo\NewRelic\DI\NewRelicExtension(%consoleMode%)
newrelic:
applicationName: fooBar
applicationModules:
web:
'/api/': Api
'/admin/': Admin
'': Front
console:
'bin/foo.php ': Foo
'': Console
autorum: FALSE
customTracers:
- 'Doctrine\ORM\EntityManager::flush'
Put $_ENV
settings (something like this) into index.php
:
<?php
$_ENV['REQUEST_TIME_FLOAT'] = microtime(TRUE);
$container = require __DIR__ . '/../app/bootstrap.php';
$_ENV['COMPILATION_TIME_FLOAT'] = microtime(TRUE);
$container->getByType(\Nette\Application\Application::class)->run();