MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / summarizeLongTasks

Function summarizeLongTasks

tooling/scripts/perf-web-runtime.mjs:471–478  ·  view source on GitHub ↗
(longTasks)

Source from the content-addressed store, hash-verified

469}
470
471function summarizeLongTasks(longTasks) {
472 const durations = longTasks.map((task) => task.duration)
473 return {
474 count: longTasks.length,
475 maxMs: round(Math.max(0, ...durations)),
476 p95Ms: round(percentile(durations, 95))
477 }
478}
479
480function sampleWindow(sample, timeOrigin) {
481 if (!sample || typeof sample.at !== 'number' || typeof sample.durationMs !== 'number') {

Callers 1

mainFunction · 0.70

Calls 2

roundFunction · 0.70
percentileFunction · 0.70

Tested by

no test coverage detected