Files
orca/config/scripts/benchmark-sample-summary.mjs
mirror 34fa2cd5ca
Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
source snapshot 2026-09-02
2026-09-02 02:03:16 +08:00

28 lines
827 B
JavaScript

export const BENCHMARK_SAMPLE_AGGREGATION = Object.freeze({
version: 2,
median: 'average-middle',
p95: 'nearest-rank',
p95Role: 'descriptive',
p95LinearDriftBoundLaunchSlots: 1
})
export function summarizeBenchmarkSamples(samples) {
if (samples.length === 0) {
throw new Error('Benchmark samples must not be empty')
}
const sorted = [...samples].sort((left, right) => left - right)
const middle = sorted.length / 2
const median = Number.isInteger(middle)
? (sorted[middle - 1] + sorted[middle]) / 2
: sorted[Math.floor(middle)]
const p95 = sorted[Math.ceil(0.95 * sorted.length) - 1]
return {
samples: samples.length,
medianMs: Number(median.toFixed(1)),
p95Ms: Number(p95.toFixed(1)),
minMs: Number(sorted[0].toFixed(1)),
maxMs: Number(sorted.at(-1).toFixed(1))
}
}