(samples)
| 71 | } |
| 72 | |
| 73 | function topInvoker(samples) { |
| 74 | let totals = new Map(); |
| 75 | for (let script of samples.flatMap(sample => sample.longFrames.flatMap(frame => frame.scripts))) { |
| 76 | totals.set(script.invoker, (totals.get(script.invoker) ?? 0) + script.duration); |
| 77 | } |
| 78 | let [invoker] = [...totals].sort((a, b) => b[1] - a[1])[0] ?? []; |
| 79 | if (!invoker) { |
| 80 | return '—'; |
| 81 | } |
| 82 | let text = invoker.length > 60 ? `${invoker.slice(0, 59)}…` : invoker; |
| 83 | return `\`${text.replaceAll('|', '\\|').replaceAll('`', "'")}\``; |
| 84 | } |
| 85 | |
| 86 | function longFrameRows(result) { |
| 87 | let rows = []; |
no test coverage detected