| Conditions | 2 |
| Paths | 2 |
| Total Lines | 36 |
| Code Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 32 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 1 | public function execute(Transaction $transaction, array $spans) |
|
| 19 | { |
||
| 20 | 1 | $result = []; |
|
| 21 | |||
| 22 | 1 | $result[] = new MetricSet( |
|
| 23 | 1 | $transaction->timestamp(), |
|
| 24 | 1 | Samples::from([ |
|
| 25 | 1 | new Sample('transaction.duration.count', 1), |
|
| 26 | 1 | new Sample('transaction.duration.sum.us', $transaction->duration()), |
|
| 27 | 1 | new Sample('transaction.breakdown.count', 1) |
|
| 28 | 1 | ]), |
|
| 29 | 1 | new \ZoiloMora\ElasticAPM\Events\MetricSet\Transaction( |
|
| 30 | 1 | $transaction->name(), |
|
| 31 | 1 | $transaction->type() |
|
| 32 | 1 | ) |
|
| 33 | 1 | ); |
|
| 34 | |||
| 35 | 1 | foreach ($spans as $span) { |
|
| 36 | 1 | $result[] = new MetricSet( |
|
| 37 | 1 | $transaction->timestamp(), |
|
| 38 | 1 | Samples::from([ |
|
| 39 | 1 | new Sample('span.self_time.count', $span->count()), |
|
| 40 | 1 | new Sample('span.self_time.sum.us', $span->sum()) |
|
| 41 | 1 | ]), |
|
| 42 | 1 | new \ZoiloMora\ElasticAPM\Events\MetricSet\Transaction( |
|
| 43 | 1 | $transaction->name(), |
|
| 44 | 1 | $transaction->type() |
|
| 45 | 1 | ), |
|
| 46 | 1 | new \ZoiloMora\ElasticAPM\Events\MetricSet\Span( |
|
| 47 | 1 | $span->type(), |
|
| 48 | 1 | $span->subtype() |
|
| 49 | 1 | ) |
|
| 50 | 1 | ); |
|
| 51 | 1 | } |
|
| 52 | |||
| 53 | 1 | return $result; |
|
| 54 | } |
||
| 56 |