Completed
Pull Request — master (#27)
by Frederic
05:43
created

StatsDMetricService   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 32
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A increment() 0 4 1
A timing() 0 4 1
1
<?php
2
3
namespace Burrow\Metric;
4
5
use Beberlei\Metrics\Collector\StatsD as Collector;
6
7
class StatsDMetricService implements MetricService
8
{
9
    /** @var Collector */
10
    private $collector;
11
12
    /**
13
     * MetricService constructor.
14
     *
15
     * @param Collector $collector
16
     */
17 9
    public function __construct(Collector $collector)
18
    {
19 9
        $this->collector = $collector;
20 9
    }
21
22
    /**
23
     * @param $key
24
     */
25 3
    public function increment($key)
26
    {
27 3
        $this->collector->increment($key);
28 3
    }
29
30
    /**
31
     * @param $key
32
     * @param float $timeInMs
33
     */
34 3
    public function timing($key, $timeInMs)
35
    {
36 3
        $this->collector->timing($key, $timeInMs);
37 3
    }
38
}
39