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

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

hgg/metrics
===========

Minimalistic library for collecting metrics during script execution

v1.0(11y ago)1399MITPHPPHP &gt;=5.3.3

Since Oct 1Pushed 8y ago1 watchersCompare

[ Source](https://github.com/hglattergotz/metrics)[ Packagist](https://packagist.org/packages/hgg/metrics)[ Docs](http://github.com/hglattergotz/metrics)[ RSS](/packages/hgg-metrics/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/cb525efb3e6aa33efd3da83f597a875db5bb8060958567a6497a92fe659c2e2c/68747470733a2f2f7472617669732d63692e6f72672f68676c6174746572676f747a2f6d6574726963732e737667)](https://travis-ci.org/hglattergotz/metrics)[![Latest Stable Version](https://camo.githubusercontent.com/4d92432c04b21197c7d269c6ea9435b2fbe79f1630db01daa9bf57c515bde983/68747470733a2f2f706f7365722e707567782e6f72672f6867672f6d6574726963732f762f737461626c652e737667)](https://packagist.org/packages/hgg/metrics)[![License](https://camo.githubusercontent.com/8b7649fbf88e7950e92debfb9a881956d3f8158ca00e92e2f4dd726431e54995/68747470733a2f2f706f7365722e707567782e6f72672f6867672f6d6574726963732f6c6963656e73652e737667)](https://packagist.org/packages/hgg/metrics)[![Code Climate](https://camo.githubusercontent.com/e30332b9d53799d40f086b0ec4bf981d12e1f1e6970bb9d4439f2847a5c30ed4/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f68676c6174746572676f747a2f6d6574726963732f6261646765732f6770612e737667)](https://codeclimate.com/github/hglattergotz/metrics)

Metrics is a container for keeping track of counters or any value for that matter and for tracking time. A common application would be to use it for a process that takes a few seconds for which various information should be collected and then logged.

The collected data can be emitted as an array or as a JSON string.

### Installation

[](#installation)

Using Composer:

```
{
    "require": {
        "hgg/metrics": "*"
    }
}
```

### Usage

[](#usage)

#### Simple use case

[](#simple-use-case)

```
