You have just joined the observability team, and logpipe/ is yours now. Nobody who wrote it is around. Read README.md and the code first: the reports below assume you know which file does what.
You have just joined the observability team, and logpipe/ is yours now. Nobody who wrote it is around. Read README.md and the code first: the reports below assume you know which file does what.
Work through the three phases. Every check is graded on its own, so each fix counts even if you do not finish.
Report: The search team's warnings never reach the dashboard. ingest("50 WARN search /query 210 r-1") returns False.
Report: With exactly 20 requests to /query, taking 10, 20, ... 200 ms, p95("/query") says 200. By the README's nearest-rank rule it is 190.
p95 follows the nearest-rank rule for any number of requests.Report: Checkout logged errors at 10:00, then went quiet. At 10:05 error_rate("checkout", now) still counts them.
error_rate(service, now) counts only the service's lines in (now - 60, now], even when the service has sent nothing since.Add slowest_endpoints(k) to LogPipeline: the k endpoints with the highest p95, as [endpoint, p95], highest first. Equal p95s go by endpoint, A to Z. With fewer than k endpoints, return them all. Build it on the pipeline's existing latency stats.
slowest_endpoints(k) returns the endpoints as described.Report: Replaying an hour of logs (about 20,000 lines) through ingest_many takes many seconds, and each line is slower than the one before. Find out why and fix it without changing what any method returns.
pytest tests/visible. Three tests fail on the current code; not every report has a failing test.Visible test command
pytest tests/visibleThe repository’s own tests. Run all tests includes them, and so does every submission.
Repository
code-comprehension-log-pipeline-debug-extend-optimise
Changes under src/ are evaluated.