Skip to content

novaphy.PerformancePhaseStat

Aggregate per-phase timing statistics captured by PerformanceMonitor.

Attributes

Attribute Description
name Phase name.
last_ms Most recently recorded duration in milliseconds.
avg_ms Average time in milliseconds.
max_ms Maximum recorded duration in milliseconds.
samples Number of recorded samples.

Example

slowest = sorted(monitor.phase_stats(), key=lambda s: s.avg_ms, reverse=True)
for stat in slowest[:5]:
    print(
        f"{stat.name}: avg={stat.avg_ms:.2f}ms, "
        f"max={stat.max_ms:.2f}ms, n={stat.samples}"
    )

See Also