Total Complexity | 8 |
Total Lines | 70 |
Duplicated Lines | 0 % |
Coverage | 88.89% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | abstract class Histogram extends Metric implements Observable |
||
12 | { |
||
13 | use TracksExecutionTime; |
||
14 | |||
15 | protected array $buckets = [ |
||
16 | .005, |
||
17 | .01, |
||
18 | .025, |
||
19 | .05, |
||
20 | .1, |
||
21 | .25, |
||
22 | .5, |
||
23 | 1, |
||
24 | 2.5, |
||
25 | 5, |
||
26 | 10, |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | 18 | public function __construct() |
|
47 | 16 | } |
|
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | 5 | public function type(): string |
|
55 | } |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | 5 | public function observe(float $value, array $labels = []): static |
|
61 | { |
||
62 | 5 | static::$storage->observe($this, $value, $labels); |
|
63 | |||
64 | 5 | return $this; |
|
65 | } |
||
66 | |||
67 | /** |
||
68 | * @return Collection |
||
69 | */ |
||
70 | 13 | public function buckets(): Collection |
|
73 | } |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | protected function track(float $value, array $labels = []): void |
||
83 |