Access-log lines look like GET /api/users?id=1 200 123ms. For each route (method plus path without
the query string), compute the 95th percentile of the latency using the nearest-rank method: sort
the values and take the element at rank ceil(0.95 × n) (1-based). Skip lines that don't match the
format. Return {"GET /api/users": 123, ...}.
Implement p95_by_route. Input: lines: list[str]. Returns: dict[str, int].
def p95_by_route(lines: list[str]) -> dict[str, int]:
return {}
Run executes the public tests. Submit grades against public and hidden tests.
Access-log lines look like GET /api/users?id=1 200 123ms. For each route (method plus path without
the query string), compute the 95th percentile of the latency using the nearest-rank method: sort
the values and take the element at rank ceil(0.95 × n) (1-based). Skip lines that don't match the
format. Return {"GET /api/users": 123, ...}.
Implement p95_by_route. Input: lines: list[str]. Returns: dict[str, int].
def p95_by_route(lines: list[str]) -> dict[str, int]:
return {}
Run executes the public tests. Submit grades against public and hidden tests.