2017 © Pedro Peláez
 

library metrics

Generic metrics, PHP Style.

image

pmg/metrics

Generic metrics, PHP Style.

  • Wednesday, October 11, 2017
  • by chrisguitarguy
  • Repository
  • 3 Watchers
  • 0 Stars
  • 495 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

Metrics

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

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).
  • 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

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

The Versions

11/10 2017

dev-master

9999999-dev

Generic metrics, PHP Style.

  Sources   Download

Apache-2.0

The Requires

  • php ~7.1

 

The Development Requires

11/10 2017

0.1.0

0.1.0.0

Generic metrics, PHP Style.

  Sources   Download

Apache-2.0

The Requires

  • php ~7.1

 

The Development Requires