(intervals)
| 19 | // skipped n - 1 frames. The period is the trial's median interval, so it adapts to |
| 20 | // the display rate and holds while fewer than half the frames are late. |
| 21 | export function missedFrames(intervals) { |
| 22 | if (!intervals.length) { |
| 23 | return null; |
| 24 | } |
| 25 | let period = percentile(intervals, 0.5); |
| 26 | return intervals.reduce( |
| 27 | (missed, interval) => missed + Math.max(0, Math.round(interval / period) - 1), |
| 28 | 0 |
| 29 | ); |
| 30 | } |
| 31 | |
| 32 | export function metrics(sample) { |
| 33 | let interactions = new Map(); |
no test coverage detected