MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / percentileStats

Function percentileStats

tests/loadtest/tools/dashboard/app.js:1297–1309  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

1295}
1296
1297function percentileStats(values) {
1298 if (!values.length) {
1299 return { p50: null, p95: null, p99: null, avg: null, max: null };
1300 }
1301 const ordered = [...values].sort((a, b) => a - b);
1302 return {
1303 p50: percentile(ordered, 50),
1304 p95: percentile(ordered, 95),
1305 p99: percentile(ordered, 99),
1306 avg: ordered.reduce((sum, value) => sum + value, 0) / ordered.length,
1307 max: ordered[ordered.length - 1],
1308 };
1309}
1310
1311function percentile(values, pct) {
1312 if (!values.length) {

Callers 1

normalizeNdjsonRunFunction · 0.85

Calls 1

percentileFunction · 0.70

Tested by

no test coverage detected