PHPackages                             itsoneiota/count - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. itsoneiota/count

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

itsoneiota/count
================

2.0.2(6y ago)04.1k2PHPPHP &gt;=7.0

Since Sep 9Pushed 6y ago3 watchersCompare

[ Source](https://github.com/itsoneiota/count)[ Packagist](https://packagist.org/packages/itsoneiota/count)[ RSS](/packages/itsoneiota-count/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (7)Used By (2)

One iota Metrics Components
===========================

[](#one-iota-metrics-components)

Background
----------

[](#background)

This a *very* slightly modified version of Etsy's StatsD example for PHP. The `Counter` class provides a static registry (It's a singleton. Don't even start.) for `StatsD` instance, allowing it to be accessed from every nook and cranny of an application.

Installing
----------

[](#installing)

This library is best installed using Composer. Include the generated Composer autoloader (usually vendor/autoload.php).

Configuring
-----------

[](#configuring)

The `StatsD` class has two constructor arguments, host and port.

Initialising
------------

[](#initialising)

The bare minimum you need to do is instantiate StatsD with your server settings and you're good to go.

To make sending metrics more accessible around your application, you can use the `Counter` static registry.

```
$statsD = new StatsD($myHost, $myPort);
Counter::setInstance($statsD);

...

Counter::increment('hits');

```

Testing Collaborators with `MockStatsD`
---------------------------------------

[](#testing-collaborators-with-mockstatsd)

If you need to test that a class is sending statistics as you expect, you can create an instance of `MockStatsD`, which can report on the current value of counters being incremented/decremented. At present, `MockStatsD` can only report on counters.

```
$statsD = new MockStatsD();
Counter::setInstance($statsD);

... test test test ...

$fooCount = $statsD->getCounter('foo');

```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~365 days

Total

4

Last Release

2483d ago

Major Versions

1.0.0 → 2.0.02019-03-05

PHP version history (2 changes)1.0.0PHP &gt;=5.4

2.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c75b278201fd2896232687d5c8e7a60ca80423bff4dd894f847e57634e3431de?d=identicon)[rossmcf](/maintainers/rossmcf)

---

Top Contributors

[![rossmcf](https://avatars.githubusercontent.com/u/94686?v=4)](https://github.com/rossmcf "rossmcf (3 commits)")[![jrodway](https://avatars.githubusercontent.com/u/39333046?v=4)](https://github.com/jrodway "jrodway (1 commits)")[![jwrodway](https://avatars.githubusercontent.com/u/43041629?v=4)](https://github.com/jwrodway "jwrodway (1 commits)")[![mattyev87](https://avatars.githubusercontent.com/u/11663120?v=4)](https://github.com/mattyev87 "mattyev87 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/itsoneiota-count/health.svg)

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

PHPackages © 2026

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