src/Client.php
public function increment($metrics, $delta = 1, $sampleRate = 1, array $tags = [])
    {
        $metrics = (array) $metrics;
        $data = array();
        if ($sampleRate < 1) {
            foreach ($metrics as $metric) {
                if ((mt_rand() / mt_getrandmax()) <= $sampleRate) {
                    $data[$metric] = $delta . '|c|@' . $sampleRate;
                }
            }
        } else {
            foreach ($metrics as $metric) {
                $data[$metric] = $delta . '|c';
            }
        }
        return $this->send($data, $tags);
    }
public function increment($metrics, $delta = 1, $sampleRate = 1, array $tags = [])
    {
        $metrics = (array) $metrics;
        $data = array();
        if ($sampleRate < 1) {
            foreach ($metrics as $metric) {
                if ((mt_rand() / mt_getrandmax()) <= $sampleRate) {
                    $data[$metric] = $delta . '|c|@' . $sampleRate;
                }
            }
        } else {
            foreach ($metrics as $metric) {
                $data[$metric] = $delta . '|c';
            }
        }
        return $this->send($data, $tags);
    }
public function increment ( $ metrics , $ delta = 1 , $ sampleRate = 1 , array $ tags = [ ] ) { $ metrics = ( array ) $ metrics ; $ data = array ( ) ; if ( $ sampleRate < 1 ) { foreach ( $ metrics as $ metric ) { if ( ( mt_rand ( ) / mt_getrandmax ( ) ) <= $ sampleRate ) { $ data [ $ metric ] = $ delta . '|c|@' . $ sampleRate ; } } } else { foreach ( $ metrics as $ metric ) { $ data [ $ metric ] = $ delta . '|c' ; } } return $ this -> send ( $ data , $ tags ) ; }
Increment a metric
@param  string|array $metrics Metric(s) to increment
@param  int $delta Value to decrement the metric by
@param  int $sampleRate Sample rate of metric
@param  array $tags A list of metric tags values
@return $this
@throws ConnectionException
Increment a metric