Function
compute_apdex
(values: list[float], threshold: float = 300.0)
Source from the content-addressed store, hash-verified
| 434 | |
| 435 | |
| 436 | def compute_apdex(values: list[float], threshold: float = 300.0) -> float | None: |
| 437 | if not values: |
| 438 | return None |
| 439 | satisfied = sum(1 for value in values if value <= threshold) |
| 440 | tolerated = sum(1 for value in values if threshold < value <= threshold * 4) |
| 441 | return (satisfied + 0.5 * tolerated) / len(values) |
| 442 | |
| 443 | |
| 444 | def last_defined(series: list[dict[str, Any]], key: str) -> float | None: |
Tested by
no test coverage detected