| Conditions | 1 |
| Paths | 1 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 7 | public function __invoke(Histogram $histogram, Collection $labels, float $value): void |
|
| 19 | { |
||
| 20 | 7 | $bucket = $histogram |
|
| 21 | 7 | ->buckets() |
|
| 22 | 7 | ->first(fn(float $bucket) => $value <= $bucket, '+Inf'); |
|
| 23 | |||
| 24 | 7 | $this->repository->increment($this->key, $labels->merge(compact('bucket'))->toJson(), 1); |
|
| 25 | 6 | $this->repository->increment("{$this->key}:SUM", $labels->toJson(), $value); |
|
| 26 | 6 | } |
|
| 28 |