2017 © Pedro Peláez
 

library php-statsd

Statsd library for PHP

image

darkflib/php-statsd

Statsd library for PHP

  • Saturday, October 19, 2013
  • by darkflib
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,548 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 69 Forks
  • 0 Open issues
  • 1 Versions
  • 10 % Grown

The README.md

PHP StatsD Client

This is an extremely simple PHP statsd client and CI spark., (*1)

Installation

Use composer..., (*2)

Usage

Counting

To count things:, (*3)

``` php $stats = new PhpStatsD\StatsD(); $stats->counting('numpoints', 123);, (*4)


### Guages ``` php $stats = new PhpStatsD\StatsD(); $stats->gauge('coffee_left', 3);

Timing

Record timings:, (*5)

``` php $stats = new PhpStatsD\StatsD(); $stats->timing('timething', 123);, (*6)


### Time Block And a convenience mechanism for timing: ``` php $stats = new PhpStatsD\StatsD(); $stats->time_this('timething', function() { sleep(1); });

Configuration

Host and Port

``` php $stats = new PhpStatsD\StatsD('localhost', 7000); // default localhost:8125, (*7)


### Sample Rate Any of the methods descriped in the usage section can take an optional third argument `$rate`, which is the sample rate: ``` php $stats = new StatsD(); $stats->counting('numpoints', 123, 0.1);

As a CodeIgniter library

php $this->load->library('statsd'); $this->statsd->counting('numpoints', 123);, (*8)

Author

John Crepezzi - john.crepezzi@gmail.com, (*9)

License

(The MIT License), (*10)

Copyright © 2012 John Crepezzi, (*11)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*12)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*13)

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. MIT License. See attached LICENSE, (*14)

The Versions

19/10 2013

dev-master

9999999-dev https://github.com/Darkflib/php-statsd

Statsd library for PHP

  Sources   Download

MIT

logging statsd graphite monitoring