Total Complexity | 5 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class LaravelDatadogHelper extends \Datadogstatsd |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * {@inheritdoc} |
||
10 | */ |
||
11 | public static function send($data, $sampleRate = 1.0, array $tags = null) { |
||
12 | $prefixedData = self::prefixData($data); |
||
13 | parent::send($prefixedData, $sampleRate, $tags); |
||
14 | } |
||
15 | |||
16 | /** |
||
17 | * Takes normal data array from Datadogstatsd library and adds the Laravel prefix functionality |
||
18 | * |
||
19 | * @param $data |
||
20 | * @return array |
||
21 | */ |
||
22 | protected static function prefixData($data) |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Prefixes a metric name if one is available via config |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | protected static function prefix($metric) |
||
46 | } |
||
47 | |||
49 |