Logging, runtime tracing, and the obs performance profiler for OCaml
0

Configure Feed

Select the types of activity you want to include in your feed.

observe: spec test for empty-capture verdict

obs report emits "CPU-bound" for a capture with wall time from the run
meta but no events at all -- no scheduler events, GC, spans, suspends or
memtrace samples. The leftover wall is unknown, not on-CPU. The test sets
only the wall clock and asserts the verdict is not CPU-bound, names the
empty case, and the report drops the "run looks balanced" line. Fails today.

+29
+29
test/obs_eio/test_memtrace_eio.ml
··· 1326 1326 "budget marks wall unattributed" true 1327 1327 (contains text "unattributed") 1328 1328 1329 + (* A capture with wall time from the run metadata but NO events at all -- no 1330 + scheduler events, domains, fibers, spans, suspends, GC, or memtrace samples -- 1331 + has no evidence to attribute. The leftover wall is unknown, not on-CPU, so the 1332 + verdict must not claim CPU-bound and the rendered report must not say "run 1333 + looks balanced". Repro: only the wall clock is set (an empty/unavailable 1334 + runtime-events stream behind a meta file that recorded elapsed time). *) 1335 + let test_empty_capture_verdict () = 1336 + let m = M.v () in 1337 + M.set_wall_clock m ~start:0. ~stop:24.836; 1338 + let r = M.report m in 1339 + Alcotest.(check bool) 1340 + "verdict denies CPU-bound" false 1341 + (contains r.Rep.verdict "CPU-bound"); 1342 + Alcotest.(check bool) 1343 + "verdict names the empty case" true 1344 + (contains r.Rep.verdict "Empty capture"); 1345 + let text = 1346 + Observer_model.Memtrace_eio.Render.to_string 1347 + Observer_model.Memtrace_eio.Render.default_opts r 1348 + in 1349 + Alcotest.(check bool) 1350 + "budget marks wall unattributed" true 1351 + (contains text "unattributed"); 1352 + Alcotest.(check bool) 1353 + "no run-looks-balanced claim" false 1354 + (contains text "run looks balanced") 1355 + 1329 1356 let suite = 1330 1357 ( "memtrace_eio", 1331 1358 [ 1332 1359 Alcotest.test_case "probe span surfaces" `Quick test_probe_span_surfaces; 1333 1360 Alcotest.test_case "hot span finding" `Quick test_hot_span; 1334 1361 Alcotest.test_case "ring-free verdict" `Quick test_ring_free_verdict; 1362 + Alcotest.test_case "empty capture verdict" `Quick 1363 + test_empty_capture_verdict; 1335 1364 Alcotest.test_case "quantile basic" `Quick test_quantile_basic; 1336 1365 Alcotest.test_case "quantile stddev" `Quick test_quantile_stddev; 1337 1366 Alcotest.test_case "quantile empty" `Quick test_quantile_empty;