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