rstgroup / statsd-module
此包的最新版本(1.3.0)没有可用的许可信息。
适用于 ZF2/ZF3 的 Statsd 模块
1.3.0
2017-12-28 09:32 UTC
Requires
- php: >=5.6
- domnikl/statsd: ^2.1
- zendframework/zend-modulemanager: ^2.4
- zendframework/zend-servicemanager: ^2.6 || ^3
Requires (Dev)
- phpunit/phpunit: ^5.6.25 || ^6.5.5
This package is not auto-updated.
Last update: 2024-09-14 19:03:58 UTC
README
该模块基于 domnikl/statsd-php.
安装
使用 composer
composer require rstgroup/statsd-module
配置
在您的 Zend Framework 应用程序配置中添加到模块列表
return [ 'modules' => [ 'RstGroup\\StatsdModule', ], ];
也在您的基于环境的自动加载配置中添加 statsd 客户端配置
return [ 'statsd' => [ 'tcp' => [ 'host' => 'example_host', 'port' => example_port, 'timeout' => null, 'persistent' => false, 'mtu' => 1500, ], 'udp' => [ 'host' => 'example_host', 'port' => example_port, 'timeout' => null, 'persistent' => false, 'mtu' => 1500, ], 'namespace' => 'services.default', 'connectionType' => 'RstGroup\Statsd\Connection\Blackhole', ], ];
连接类型
RstGroup\Statsd\Connection\Udp
RstGroup\Statsd\Connection\Tcp
不会在此模式下抑制错误RstGroup\Statsd\Connection\Memory
在此模式下发送被禁用,但消息被收集RstGroup\Statsd\Connection\Blackhole
在此模式下发送被禁用
使用方法
从 ServiceManager 的典型用法
$client = $serviceManager->get("RstGroup\Statsd\Client");