| 84 | } |
| 85 | |
| 86 | function longFrameRows(result) { |
| 87 | let rows = []; |
| 88 | for (let scenario of result.scenarios) { |
| 89 | for (let arm of Object.keys(result.builds)) { |
| 90 | let samples = result.samples.filter( |
| 91 | sample => sample.scenario === scenario.id && sample.arm === arm |
| 92 | ); |
| 93 | if (samples.some(sample => sample.longFramesSupported === false)) { |
| 94 | rows.push(`| ${scenario.id} / ${arm} | unsupported | — | — | — | — | — | — |`); |
| 95 | continue; |
| 96 | } |
| 97 | let observed = samples.filter(sample => sample.metrics.longFrames); |
| 98 | let median = metric => |
| 99 | observed.length |
| 100 | ? ms( |
| 101 | percentile( |
| 102 | observed.map(sample => sample.metrics[metric]), |
| 103 | 0.5 |
| 104 | ) |
| 105 | ) |
| 106 | : '—'; |
| 107 | rows.push( |
| 108 | `| ${scenario.id} / ${arm} | ${observed.length}/${samples.length} | ${observed.length ? ms(Math.max(...observed.map(sample => sample.metrics.longFrameMax))) : 'none reported'} | ${median('longFrameBlocking')} | ${median('longFrameScript')} | ${median('longFrameStyleLayout')} | ${median('longFrameForcedLayout')} | ${topInvoker(observed)} |` |
| 109 | ); |
| 110 | } |
| 111 | } |
| 112 | return rows; |
| 113 | } |
| 114 | |
| 115 | export function random(seed) { |
| 116 | return () => { |