Skip to content

schedstat: per-cycle GC mark assist breakdown#8

Merged
tbg merged 1 commit into
mainfrom
per-cycle-gc-detail
May 8, 2026
Merged

schedstat: per-cycle GC mark assist breakdown#8
tbg merged 1 commit into
mainfrom
per-cycle-gc-detail

Conversation

@tbg
Copy link
Copy Markdown
Collaborator

@tbg tbg commented Mar 13, 2026

Summary

  • Show per-cycle GC detail with mark assist breakdown (event counts, goroutine counts, top affected goroutines per cycle) after the sweep summary, replacing the former verbose-only per-cycle table
  • Drop the cross-cycle mark assist summary entirely (aggregate "Mark assist: ..." line + "Top affected goroutines" sub-list); per-cycle view subsumes both at higher fidelity
  • GC section order is now: cycle summary, STW, latency comparison, sweep, per-cycle detail
  • JSON: removes gc.mark_assist; replaces gc.per_cycle shape with new GCPerCycleDetail carrying per-cycle assist totals + top goroutines

Makes it easy to spot which specific GC cycle was problematic at a glance.

Test plan

  • go test ./... — text + JSON golden tests pass
  • go run . testdata/single-node-lowcpu-gcassist.bin --gc — 2-cycle trace
  • go run . testdata/experiment-upsert1000-gateway.bin --gc — 1-cycle trace
  • go run . testdata/experiment-upsert1000-leaseholder.bin --gc — 2-cycle trace

Replace the cross-cycle mark assist summary (and the verbose-only
per-cycle table) with a single per-cycle GC detail section shown
unconditionally after the sweep summary. For each GC cycle we now show:

  Cycle N @ t=Xms, duration: Y
    Mark assist: N events, M goroutines, total: T
      g<id>     <name>        N assists, total T, max T @ t=Xms
      ...

Cycles with no mark assists collapse to a single "(no mark assists)"
line. The previous aggregate "Mark assist: ..." line is dropped — the
per-cycle view contains the same information at higher fidelity, plus
the cycle that the burst belongs to. The verbose-only per-cycle table
is removed since the new section subsumes it.

GC analysis section order is now: cycle summary, STW, latency
comparison, sweep, per-cycle detail.

JSON: GCMarkAssist and the old GCPerCycleBreakdown types are removed;
the new GCPerCycleDetail / GCCycleDetail / CycleAssistG types take their
place. JSON goldens regenerated.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@tbg tbg force-pushed the per-cycle-gc-detail branch from 8062571 to 3864813 Compare May 8, 2026 10:34
@tbg tbg marked this pull request as ready for review May 8, 2026 10:37
@tbg tbg merged commit 48e3fb2 into main May 8, 2026
1 check passed
@tbg tbg deleted the per-cycle-gc-detail branch May 8, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant