Files

13 lines
755 B
Kotlin

import com.gorios.lanvoice.diag.DiagnosticLog
fun boundedRuntimeDiagnosticCheck() {
val before=DiagnosticLog.snapshot().size
repeat(501) { DiagnosticLog.state("bounded_test","action","owner=action frame=$it",it.toLong()) }
check(DiagnosticLog.snapshot().size==before+1)
DiagnosticLog.state("bounded_test","action","owner=action frame=240",10_000)
DiagnosticLog.state("bounded_test","conversation","owner=conversation frame=96",10_001)
check(DiagnosticLog.snapshot().size==before+3)
repeat(600) { DiagnosticLog.record("bounded_ring","fixed_enum=sample") }
check(DiagnosticLog.snapshot().size==500)
println("PASS: bounded runtime diagnostics: state changes +10s monotonic summaries, no per-frame churn,500-entry ring")
}