Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rstgroup/statsd-module

Statsd module for Zend Framework 2
https://github.com/rstgroup/statsd-module

Last synced: 27 days ago
JSON representation

Statsd module for Zend Framework 2

Awesome Lists containing this project

README

        

# rstgroup/statsd-module [![Build Status](https://travis-ci.org/rstgroup/statsd-module.svg?branch=master)](https://travis-ci.org/rstgroup/statsd-module)

Module is based on [domnikl/statsd-php](https://github.com/domnikl/statsd-php).

## Installation

Using composer:

```
composer require rstgroup/statsd-module
```

## Configuration

In your Zend Framework application config add to module list

```php
return [
'modules' => [
'RstGroup\\StatsdModule',
],
];
```

also in your autoload config based on enviroment add statsd client configuration

```php
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 mode
* `RstGroup\Statsd\Connection\Memory` in this mode sending is disabled, but messages are collected
* `RstGroup\Statsd\Connection\Blackhole` in this mode sending is disabled

## Usage

Typical usage from ServiceManager

```php
$client = $serviceManager->get("RstGroup\Statsd\Client");
```