category OSS
package OSS_StatsD
copyright Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland
license New BSD License
link https://github.com/etsy/statsd/blob/master/examples/php-example.php

 Methods

Construct the object with the host and port to use.

__construct(string $host, int $port, bool $enabled) 

Parameters

$host

string

The StatsD host

$port

int

The StatsD port

$enabled

bool

Whether we should sent updates or not

Decrements one or more stats counters.

decrement(string | array $stats, float | \1 $sampleRate) : boolean

Parameters

$stats

stringarray

The metric(s) to decrement.

$sampleRate

float\1

the rate (0-1) for sampling.

Returns

boolean

Increments one or more stats counters

increment(string | array $stats, float | \1 $sampleRate) : boolean

Parameters

$stats

stringarray

The metric(s) to increment.

$sampleRate

float\1

the rate (0-1) for sampling.

Returns

boolean

Indicates whether StatsD is enabled by configuration or not

isEnabled() : bool

Returns

bool

send()

send($data, $sampleRate) 

Parameters

$data

$sampleRate

Log timing information

timing(string $stat, float $time, float | \1 $sampleRate) 

Parameters

$stat

string

The metric to in log timing info for.

$time

float

The ellapsed time (ms) to log

$sampleRate

float\1

the rate (0-1) for sampling.

Updates one or more stats counters by arbitrary amounts.

updateStats(string | array $stats, int | \1 $delta, float | \1 $sampleRate) : boolean

Parameters

$stats

stringarray

The metric(s) to update. Should be either a string or array of metrics.

$delta

int\1

The amount to increment/decrement each metric by.

$sampleRate

float\1

the rate (0-1) for sampling.

Returns

boolean

 Properties

 

<p>Determines whther we are gathering statistics or not</p>

$_enabled : bool
 

<p>The StatsD host</p>

$_host : string
 

<p>The StatsD port</p>

$_port : int