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

StatsDMetricService::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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