MCPcopy Create free account
hub / github.com/adobe/react-spectrum / longFrameRows

Function longFrameRows

perf/report.mjs:86–113  ·  view source on GitHub ↗
(result)

Source from the content-addressed store, hash-verified

84}
85
86function 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
115export function random(seed) {
116 return () => {

Callers 1

reportFunction · 0.85

Calls 5

medianFunction · 0.85
topInvokerFunction · 0.85
pushMethod · 0.80
msFunction · 0.70
filterMethod · 0.65

Tested by

no test coverage detected