Datadogstatsd::updateStats PHP Méthode

updateStats() public static méthode

Updates one or more stats counters by arbitrary amounts.
public static updateStats ( string | array $stats, integer $delta = 1, float $sampleRate = 1, array $tags = null ) : boolean
$stats string | array The metric(s) to update. Should be either a string or array of metrics.
$delta integer The amount to increment/decrement each metric by.
$sampleRate float the rate (0-1) for sampling.
$tags array Key Value array of Tag => Value, or single tag as string
Résultat boolean
    public static function updateStats($stats, $delta = 1, $sampleRate = 1.0, array $tags = null)
    {
        if (!is_array($stats)) {
            $stats = array($stats);
        }
        $data = array();
        foreach ($stats as $stat) {
            $data[$stat] = "{$delta}|c";
        }
        static::send($data, $sampleRate, $tags);
    }