Datadogstatsd::histogram PHP Méthode

histogram() public static méthode

Histogram
public static histogram ( 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 histogram($stat, $value, $sampleRate = 1.0, array $tags = null)
    {
        static::send(array($stat => "{$value}|h"), $sampleRate, $tags);
    }

Usage Example

<?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