WeCodeAcademy

Step 5: Traffic over time

Problems have a when. Cut the timestamp to the minute (e["time"][:5] turns 09:01:20 into 09:01) and count per bucket. A tiny text bar chart ("#" * count) shows the shape of the traffic in a terminal, and the minute with the most errors points to the incident.

Examplepython
Open in editor »

Cutting a string is the simplest bucketing. For real timestamps you would parse them with datetime so you can bucket by 5 minutes, hours or days.

Quick check

What does grouping requests by minute help you see?

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.