| Total Complexity | 7 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Coverage | 64.71% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | abstract class Gauge extends Metric implements Incrementable, Decrementable, Settable |
||
| 11 | { |
||
| 12 | use TracksExecutionTime; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * {@inheritdoc} |
||
| 16 | */ |
||
| 17 | 15 | public function type(): string |
|
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * {@inheritdoc} |
||
| 24 | */ |
||
| 25 | public function increment(array $labels = []): static |
||
| 26 | { |
||
| 27 | return $this->incrementBy(1, $labels); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * {@inheritdoc} |
||
| 32 | */ |
||
| 33 | 10 | public function incrementBy(float $value, array $labels = []): static |
|
| 34 | { |
||
| 35 | 10 | static::$storage->increment($this, $value, $labels); |
|
| 36 | |||
| 37 | 10 | return $this; |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * {@inheritdoc} |
||
| 42 | */ |
||
| 43 | public function decrement(array $labels = []): static |
||
| 44 | { |
||
| 45 | return $this->decrementBy(1, $labels); |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | 5 | public function decrementBy(float $value, array $labels = []): static |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * {@inheritdoc} |
||
| 60 | */ |
||
| 61 | 5 | public function set(float $value, array $labels = []): static |
|
| 62 | { |
||
| 63 | 5 | static::$storage->set($this, $value, $labels); |
|
| 64 | |||
| 65 | 5 | return $this; |
|
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * {@inheritdoc} |
||
| 70 | */ |
||
| 71 | protected function track(float $value, array $labels = []): void |
||
| 74 | } |
||
| 75 | } |
||
| 76 |