rstgroup / statsd-module
Statsd module for ZF2/ZF3
Installs: 66 843
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 7
Forks: 2
Open Issues: 0
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-10-26 19:39:35 UTC
README
Module is based on domnikl/statsd-php.
Installation
Using composer:
composer require rstgroup/statsd-module
Configuration
In your Zend Framework application config add to module list
return [ 'modules' => [ 'RstGroup\\StatsdModule', ], ];
also in your autoload config based on enviroment add statsd client configuration
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', ], ];
Connection types:
RstGroup\Statsd\Connection\Udp
RstGroup\Statsd\Connection\Tcp
errors will not be suppressed in this modeRstGroup\Statsd\Connection\Memory
in this mode sending is disabled, but messages are collectedRstGroup\Statsd\Connection\Blackhole
in this mode sending is disabled
Usage
Typical usage from ServiceManager
$client = $serviceManager->get("RstGroup\Statsd\Client");