Datadogstatsd::set PHP Method

set() public static method

Set
public static set ( string $stat, float $value, float $sampleRate = 1, array $tags = null )
$stat string The metric
$value float The value
$sampleRate float the rate (0-1) for sampling.
$tags array Key Value array of Tag => Value, or single tag as string
    public static function set($stat, $value, $sampleRate = 1.0, array $tags = null)
    {
        static::send(array($stat => "{$value}|s"), $sampleRate, $tags);
    }

Usage Example

Ejemplo n.º 1
0
<?php

require '../libraries/datadogstatsd.php';
Datadogstatsd::increment('web.page_views');
Datadogstatsd::histogram('web.render_time', 15);
Datadogstatsd::set('web.uniques', 3);
Datadogstatsd::service_check('my.service.check', Datadogstatsd::CRITICAL);
//All the following metrics will be sent in a single UDP packet to the statsd server
BatchedDatadogstatsd::increment('web.page_views');
BatchedDatadogstatsd::histogram('web.render_time', 15);
BatchedDatadogstatsd::set('web.uniques', 3);
BatchedDatadogstatsd::flush_buffer();
// Necessary