File size: 437 Bytes
9ad188a
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
# Communication efficiency — SLO pass/fail on response latency.

def compute_efficiency(latency_log: dict, slo_target: float = 6.0) -> dict:
    """Check if total response time meets the SLO target."""
    t_total = latency_log.get("t_total", 0.0)
    return {
        "t_total": round(t_total, 3),
        "slo_target": slo_target,
        "slo_passed": t_total < slo_target,
        "margin_s": round(slo_target - t_total, 3),
    }