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

Function parseMainPerfSamples

tooling/scripts/perf-desktop-runtime.mjs:421–431  ·  view source on GitHub ↗
(log)

Source from the content-addressed store, hash-verified

419}
420
421function parseMainPerfSamples(log) {
422 const samples = []
423 const pattern = /\[zen:perf\]\s+([^\s]+)\s+([0-9.]+)ms/g
424 for (const match of log.matchAll(pattern)) {
425 samples.push({
426 name: match[1],
427 durationMs: Number.parseFloat(match[2])
428 })
429 }
430 return samples
431}
432
433function percentile(values, p) {
434 if (values.length === 0) return 0

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected