Build a small metrics API. Each time a request comes in, count how many times that path was hit, and return the per-path counts so far at /stats. Finish Counter's Record and Snapshot. (The server wiring newServer and the test server_test.go are provided.) Note: Record(path) β increment that path's count by 1. Snapshot() β return the per-path counts so far. Requests arrive at /hit/<name>, and /stats reads the tally.
Complete a small metrics API in the Go standard library (net/http) that counts requests per path. Each request bumps that path's count, and /stats returns the per-path totals. You practice verifying a server that holds up even when many requests arrive at once.
A web server handles each request separately, so what happens when many requests touch the same data at once is the crux. Code that runs fine when idle can fall apart under load β values drift, or the server dies now and then. Plain sequential requests hide a lot, so it matters to build the habit of firing many requests at once. This problem covers the safety of many requests touching shared data at the same time.