Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.
/ metrix Public archive

PHP metrics library for make benefit glorious startup of you

Notifications You must be signed in to change notification settings

cuusoo/metrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metrix PHP Library

Metrix is a PHP library that provides a simple interface for sending metric data to a number of services. Currently Metrix supports StatsD and Librato.

Build Status

Configuration

Librato:

$client = new Metrix();
$client->config(array(
    'backend' => 'librato',
    'opts' => array(
      'email' => '[email protected]',
      'token' => '123'
    )
));

StatsD:

$client = new Metrix();
$client->config(array(
    'backend' => 'statsd',
    'opts' => array(
      'host' => '127.0.0.1', // defaults to this
      'port' => '8125' // defaults to this
    )
));

Counters

$client->increment('key', 10);
$client->increment(array('key1', 'key2', ...));
$client->increment(array(
  'key' => 1
));

$client->decrement('key', 10);
...

Gauges

$client->gauge('cputemp', 55);

Other Options

Custom key prefixes (prefix_delimeter defaults to '.'):

$client->config(array('
  'prefix' => 'foo',
  'prefix_delimeter' => ':',
  ...
));

TODO

  • Specify source for Metrics

About

PHP metrics library for make benefit glorious startup of you

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages