PHP code example of bigcommerce / grphp-statsd
1. Go to this page and download the library: Download bigcommerce/grphp-statsd library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bigcommerce / grphp-statsd example snippets
$config = [
'host' => 'my.statsd.service',
'port' => 8125,
// optional config options
'namespace' => 'myapp',
'sample_rate' => 1.0, // 0->1.0 scale. 1.0 is all requests.
'mtu' => 1500, // MTU rate
'persistent' => false, // keep connection persistent
'timeout' => 600, // in seconds
'tcp' => false, // true uses TCP instead of UDP
];
$client->addInterceptor(new \Grphp\StatsD\Interceptor($config));