Documentation
¶
Overview ¶
Package perfcheck provides Go 1.27 goroutineleak profiling, heap growth tracking, goroutine-count settle assertions, and overlay graph topology metrics for tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertNoGoroutineLeaks ¶
AssertNoGoroutineLeaks uses Go 1.27's GA goroutineleak profile to detect any permanently blocked goroutines whose synchronization primitives are unreachable from live code.
Types ¶
type GoroutineBaseline ¶
type GoroutineBaseline struct {
Start int
}
GoroutineBaseline captures the initial goroutine count before a test starts.
func CaptureGoroutines ¶
func CaptureGoroutines() GoroutineBaseline
CaptureGoroutines records the current goroutine count after a brief settle.
func (GoroutineBaseline) AssertSettled ¶
AssertSettled polls until NumGoroutine() <= Start + maxDelta or fails on timeout.
type GraphMetrics ¶
type GraphMetrics struct {
Nodes int
Edges int
Components int
GiantSize int
Diameter int
AvgPathLen float64
MinDegree int
MaxDegree int
AvgDegree float64
IsolatedNodes int
}
GraphMetrics summarizes connected components and shortest-path hop distances.
func AnalyzeGraph ¶
func AnalyzeGraph(adj map[string][]string) GraphMetrics
AnalyzeGraph computes connected components, giant component, exact diameter, and degree stats over an undirected adjacency map (if only directed edges exist, callers should symmetrize first or AnalyzeGraph will symmetrize automatically).
type HeapSnapshot ¶
HeapSnapshot records live heap statistics after GC.
func TakeHeapSnapshot ¶
func TakeHeapSnapshot() HeapSnapshot
TakeHeapSnapshot triggers GC and returns current heap metrics in KiB.