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

Function percentile

tests/loadtest/tools/dashboard_parser.py:425–433  ·  view source on GitHub ↗
(values: list[float], pct: int)

Source from the content-addressed store, hash-verified

423
424
425def percentile(values: list[float], pct: int) -> float | None:
426 if not values:
427 return None
428 k = (len(values) - 1) * (pct / 100.0)
429 lower = math.floor(k)
430 upper = math.ceil(k)
431 if lower == upper:
432 return values[lower]
433 return values[lower] + (values[upper] - values[lower]) * (k - lower)
434
435
436def compute_apdex(values: list[float], threshold: float = 300.0) -> float | None:

Callers 1

percentile_statsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected