PHPackages                             pmg/metrics - 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. pmg/metrics

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

pmg/metrics
===========

Generic metrics, PHP Style.

v0.2.0(4y ago)13.1k1Apache-2.0PHPPHP ^7.4 || ^8.0

Since Oct 11Pushed 4y ago3 watchersCompare

[ Source](https://github.com/AgencyPMG/metrics)[ Packagist](https://packagist.org/packages/pmg/metrics)[ RSS](/packages/pmg-metrics/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (3)Used By (1)

Metrics
=======

[](#metrics)

**Warning: this is very unstable software right now**. PMG is adding features to this as we need them.

Core Concepts
-------------

[](#core-concepts)

- A **Collector** collects metrics over the course of an application lifecycle and stores them someplace locally (usually just in memory)
- A **Reporter** takes a *metric set* flushed out of a collector and sends it to a real metrics backend (like [cloudwatch](https://github.com/AgencyPMG/metrics-cloudwatch)).
- A **Metric** is just some sort of measurement taken with an application. Comes in several flavors.
    - A **Gauge** is a static value taken at a point in time.

Usage Example
-------------

[](#usage-example)

```
use PMG\Metrics\Metrics;
use PMG\Metrics\Gauge;

$collector = Metrics::collector();

// track `someName` with a count gauge with a value of 10
$collector->gauge('someName', Gauge::count(10));

// Same as the above but tag `someName` with dimensions
$collector->gauge(
    Metrics::name('someName')->dimension('example', '1'),
    Gauge::count(10)
);

/* @var Reporter $reporter **/
$reporter->reportOn($collector->flush());

// $collector is now empty and ready to go
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1476 days

Total

2

Last Release

1661d ago

PHP version history (2 changes)0.1.0PHP ~7.1

v0.2.0PHP ^7.4 || ^8.0

### Community

Maintainers

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

---

Top Contributors

[![chrisguitarguy](https://avatars.githubusercontent.com/u/1010392?v=4)](https://github.com/chrisguitarguy "chrisguitarguy (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pmg-metrics/health.svg)

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

PHPackages © 2026

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