nti/metrics-bundle
最新稳定版本:v1.1.0
Composer 安装命令:
composer require nti/metrics-bundle
包简介
Send metrics to StatsD Server.
关键字:
README 文档
README
StatsD Client
Installation
-
Install the bundle using composer:
$ composer require nti/metrics-bundle "dev-master" -
Add the bundle configuration to the AppKernel
public function registerBundles() { $bundles = array( ... new NTI\MetricsBundle\NTIMetricsBundle(), ... ); }
-
Setup the configuration in the
config.yml
# NTI Metrics nti_metrics: host: "statsDserver" # default: localhost port: 8125 # default: 8125 prefix: "greenlink." # default: ""
Usage
- Get the Metrics Client service
$collector = $container->get('nti.metrics');
The following methods are available for send metrics:
$collector->increment('glbs.email.send'); # Same as send "glbs.email.send:1|c" $collector->decrement('glbs.email.send'); # Same as send "glbs.email.send:-1|c"
To send the values to statsD server you have to call the following method:
$collector->flush();
统计信息
- 总下载量: 1.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-23