| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | 31 | protected function transform(MetricFamilySamples $family): Collection |
|
| 50 | { |
||
| 51 | 31 | $metric = $family->metric(); |
|
| 52 | |||
| 53 | 31 | $lines = new Collection([ |
|
| 54 | 31 | "# HELP {$metric->key()} {$metric->description()}", |
|
| 55 | 31 | "# TYPE {$metric->key()} {$metric->type()}", |
|
| 56 | ]); |
||
| 57 | |||
| 58 | $metrics = $family->samples()->map(function (Sample $sample) { |
||
| 59 | 31 | return "{$sample->name()}{$this->serialize($sample->labels())} {$sample->value()}"; |
|
| 60 | 31 | })->values(); |
|
| 61 | |||
| 62 | 31 | return $lines->merge($metrics); |
|
| 63 | } |
||
| 65 |