stikmanw/silex-newrelic
最新稳定版本:v1.0.0
Composer 安装命令:
composer require stikmanw/silex-newrelic
包简介
Integrate the NewRelic PHP API into Silex framework
README 文档
README
Integrate the NewRelic PHP Agent API into Silex framework.
Acknowledgement
This was originally created by mcuadros. credit goes to him for his hardwork.
Requirements
- PHP 5.3.x
- intouch/newrelic
- newrelic >= 3.1
Versions
This project recently changed hands. See the below updated verions for information on how to require correct dependency.
- v0.1.0 - Original Repo state used ini settings supported by older versions of NewRelic PHP Agent
- v1.0.0 - Removed ini settings and replaced with more direct hooks into Intouch/NewRelic library
Installation
The recommended way to install NewRelic/Silex is through composer. You can see the package information on Packagist.
Run composer require to get the latest version:
composer require stikmanw/silex-newrelic
Methods
newrelic.custom_parameter( string $key, $value ): Assign a custom parameter to be captured for the request by NewRelic Agent. Details: NewRelic custom_parameternewrelic.custom_metric(string $name, mixed $value): Assign a metric name and value to be captured by NewRelic Agent. Details: NewRelic custom_metric
Parameters
Set all parameters in the array $app['newrelic.options']:
application_name(default 'Silex PHP Application'): Sets the name of the application to name.transaction_name_method(default 'uri'): if 'uri' the request URI will be used as transaction name, if 'route' will be used the alias name from the route.transaction_tracer_detail(default 1): check it at newrelic.transaction_tracer.detail not supported 1.0.0capture_params(default false): determine if the request should capture parameters specified by NewRelic docs. newrelic.capture_paramsignored_params(default ''): check it at newrelic.ignored_params not supported 1.0.0disable_auto_rum(default false): Prevents the output filter from attempting to insert RUM JavaScript for this current transaction. Useful for AJAX calls, for example.ignored_transaction(default false): do not send the transaction for tracking to the agent. added 1.0.0 newrelic.ignored_paramscustom_params(default array()):list of custom params to assign to the request, see custom_params method above. added 1.0.0custom_metrics(default array()): custom metrics to setup when the provider is registered, see custom_metrics method above. added 1.0.0
Registering
$app->register(new NewRelic\Silex\NewRelicServiceProvider()); $app['newrelic.options'] = array( 'application_name' => 'Example PHP Application', 'transaction_name_method' => 'route' );
Tests
Tests are in the tests folder.
To run them, you need PHPUnit.
Example:
$ phpunit --configuration phpunit.xml.dist
License
MIT, see LICENSE
统计信息
- 总下载量: 14.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 20
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-06-24