PHPackages                             eleme/statsd - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. eleme/statsd

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

eleme/statsd
============

A simple library for working with StatsD in PHP. Base on league/statsd

1.4.1(9y ago)0821[1 PRs](https://github.com/No5stranger/statsd/pulls)MITPHP

Since Aug 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/No5stranger/statsd)[ Packagist](https://packagist.org/packages/eleme/statsd)[ Docs](https://github.com/No5stranger/statsd)[ RSS](/packages/eleme-statsd/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (2)Versions (7)Used By (0)

StatsD PHP Library
==================

[](#statsd-php-library)

[![Build Status](https://camo.githubusercontent.com/0ee29d7133988c43cb5b13da3d6c01d0959abcac42debc753c26b607764f9568/68747470733a2f2f7472617669732d63692e6f72672f7468657068706c65616775652f7374617473642e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/thephpleague/statsd)[![Total Downloads](https://camo.githubusercontent.com/929fd87ce99c25b0379290fc969632000e06e3dd29234bdee271e42d9966ac13/68747470733a2f2f706f7365722e707567782e6f72672f6c65616775652f7374617473642f646f776e6c6f6164732e706e67)](https://packagist.org/packages/league/statsd)[![Latest Stable Version](https://camo.githubusercontent.com/13625aa8eca0e1e9de9f05a350a0bd50f4502d079c7e74d78bbc9184f4e5e908/68747470733a2f2f706f7365722e707567782e6f72672f6c65616775652f7374617473642f762f737461626c652e706e67)](https://packagist.org/packages/league/statsd)[![Bitdeli Badge](https://camo.githubusercontent.com/28ad969254688238b567786daa841d14ac21d4d0b48c120f496db81faa17c454/68747470733a2f2f64327765637a68766c38323376302e636c6f756466726f6e742e6e65742f7468657068706c65616775652f7374617473642f7472656e642e706e67)](https://bitdeli.com/free "Bitdeli Badge")

A library for working with StatsD in PHP.

Install
-------

[](#install)

Via Composer

```
{
    "require": {
        "league/statsd": "1.4.*"
    }
}
```

To use the Statsd Service Provider, you must register the provider when bootstrapping your Laravel application.

Find the `providers` key in your `app/config/app.php` and register the Statsd Service Provider.

```
    'providers' => array(
        // ...
        'League\StatsD\Laravel\Provider\StatsdServiceProvider',
    )
```

Find the `aliases` key in your `app/config/app.php` and add the Statsd Facade Alias.

```
    'aliases' => array(
        // ...
        'Statsd' => 'League\StatsD\Laravel\Facade\StatsdFacade',
    )
```

For Laravel 5:

Find the `providers` key in your `config/app.php` and register the Statsd Service Provider.

```
    'providers' => [
        // ...
        League\StatsD\Laravel5\Provider\StatsdServiceProvider::class,
    ]
```

Find the `aliases` key in your `app/config/app.php` and add the Statsd Facade Alias.

```
    'aliases' => [
        // ...
        'Statsd' => League\StatsD\Laravel5\Facade\StatsdFacade::class,
    ]
```

Usage
-----

[](#usage)

### Configuring

[](#configuring)

```
$statsd = new League\StatsD\Client();
$statsd->configure(array(
    'host' => '127.0.0.1',
    'port' => 8125,
    'namespace' => 'example'
));
```

OR

```
$statsd1 = StatsD\Client::instance('server1')->configure(array(...));
$statsd2 = StatsD\Client::instance('server2')->configure(array(...));
```

The StatsD client wait for `ini_get('default_socket_timeout')` seconds when opening the socket by default. To reduce this timeout, add `'timeout' => ` to your config.

The StatsD client will throw a `ConnectionException` if it is unable to send data to the StatsD server. You may choose to disable these exceptions and log a PHP warning instead if you wish. To do so, include the following in your config:

```
    'throwConnectionExceptions' => false

```

If omitted, this option defaults to `true`.

### Counters

[](#counters)

```
$statsd->increment('web.pageview');
$statsd->decrement('storage.remaining');
$statsd->increment(array(
    'first.metric',
    'second.metric'
), 2);
$statsd->increment('web.clicks', 1, 0.5);
```

### Gauges

[](#gauges)

```
$statsd->gauge('api.logged_in_users', 123456);
```

### Sets

[](#sets)

```
$userID = 23;
$statsd->set('api.unique_logins', $userID);
```

### Timers

[](#timers)

```
$statsd->timing('api.response_time', 256);
```

Timing Blocks
-------------

[](#timing-blocks)

```
$statsd->time('api.dbcall', function () {
    // this code execution will be timed and recorded in ms
});
```

Testing
-------

[](#testing)

```
phpunit

```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/thephpleague/statsd/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Marc Qualie](https://github.com/marcqualie)
- [All Contributors](https://github.com/thephpleague/statsd/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/thephpleague/statsd/blob/master/LICENSE) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 72.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~219 days

Recently: every ~235 days

Total

6

Last Release

3545d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a6294edd6980e753992c1312c144a831af5aafb15ad025355268f50fc9d9952?d=identicon)[No5stranger](/maintainers/No5stranger)

---

Top Contributors

[![marcqualie](https://avatars.githubusercontent.com/u/101022?v=4)](https://github.com/marcqualie "marcqualie (104 commits)")[![aranw](https://avatars.githubusercontent.com/u/241565?v=4)](https://github.com/aranw "aranw (12 commits)")[![richardbenson](https://avatars.githubusercontent.com/u/98186?v=4)](https://github.com/richardbenson "richardbenson (6 commits)")[![michaelmoussa](https://avatars.githubusercontent.com/u/183833?v=4)](https://github.com/michaelmoussa "michaelmoussa (5 commits)")[![nikkiii](https://avatars.githubusercontent.com/u/891176?v=4)](https://github.com/nikkiii "nikkiii (4 commits)")[![danalloway](https://avatars.githubusercontent.com/u/2057295?v=4)](https://github.com/danalloway "danalloway (3 commits)")[![No5stranger](https://avatars.githubusercontent.com/u/6914351?v=4)](https://github.com/No5stranger "No5stranger (2 commits)")[![thbourlove](https://avatars.githubusercontent.com/u/1768066?v=4)](https://github.com/thbourlove "thbourlove (2 commits)")[![philsturgeon](https://avatars.githubusercontent.com/u/67381?v=4)](https://github.com/philsturgeon "philsturgeon (1 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")[![ubermuda](https://avatars.githubusercontent.com/u/10758?v=4)](https://github.com/ubermuda "ubermuda (1 commits)")[![threesquared](https://avatars.githubusercontent.com/u/892142?v=4)](https://github.com/threesquared "threesquared (1 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")

---

Tags

statsdlibrarygraphite

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eleme-statsd/health.svg)

```
[![Health](https://phpackages.com/badges/eleme-statsd/health.svg)](https://phpackages.com/packages/eleme-statsd)
```

###  Alternatives

[league/statsd

A simple library for working with StatsD in PHP.

3514.3M12](/packages/league-statsd)[liuggio/statsd-client-bundle

Provides a statsd client and simple ready-to-use support for #Symfony2 Application

164730.7k](/packages/liuggio-statsd-client-bundle)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)[liuggio/statsd-php-client

Statsd (Object Oriented) client library for PHP

1153.9M9](/packages/liuggio-statsd-php-client)[socloz/monitoring-bundle

A profiling/monitoring Symfony2 bundle for production servers - alerts on exceptions, logs profiling data &amp; sends data to statsd/graphite

6944.2k](/packages/socloz-monitoring-bundle)[slickdeals/statsd

a PHP client for statsd

264.5M8](/packages/slickdeals-statsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
