PHP code example of lsjroberts / datadog-statsd

1. Go to this page and download the library: Download lsjroberts/datadog-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/ */

    

lsjroberts / datadog-statsd example snippets


'Statsd' => 'DataDog\Statsd\Facades\Illuminate',
 php
Statsd::decrement('your.data.point');
 php
$start_time = microtime(true);
run_function();
Statsd::timing('your.data.point', microtime(true) - $start_time);

Statsd::timing('your.data.point', microtime(true) - $start_time, 1, array('tagname' => 'value'));
 php
$apiKey = 'myApiKey';
$appKey = 'myAppKey';

Statsd::configure($apiKey, $appKey);
Statsd::event('A thing broke!', array(
	'alert_type'      => 'error',
	'aggregation_key' => 'test_aggr'
));
Statsd::event('Now it is fixed.', array(
	'alert_type'      => 'success',
	'aggregation_key' => 'test_aggr'
));