← Lesson
Metrics That Page a Human
Joeven
Run
Reset
Python loads on first run
def should_page(snap): reasons = [] if snap.get("forbidden_tool", 0) > 0: reasons.append("forbidden_tool") if snap.get("usd_per_min", 0) > snap.get("usd_cap_per_min", 1): reasons.append("cost") if snap.get("queue_depth", 0) > 200 and snap.get("queue_high_for_min", 0) >= 10: reasons.append("queue") if snap.get("hitl_wait_s", 0) > snap.get("hitl_sla_s", 600): reasons.append("hitl_sla") if snap.get("llm_timeouts", 0) > 0 and not reasons: return {"page": False, "why": "timeouts_on_dashboard"} return {"page": bool(reasons), "why": reasons} print("storm", should_page({"forbidden_tool": 3, "usd_per_min": 0.2})) print("timeout only", should_page({"llm_timeouts": 12})) print("queue", should_page({"queue_depth": 500, "queue_high_for_min": 12}))
Run to execute this in your browser. Nothing is sent to a server.