Documentation
¶
Overview ¶
Package debug provides opt-in profiling helpers for the .lsc profile` subcommand. It is deliberately narrow — anything that flips a global runtime knob (GC percent, memory limit, traceback level) lives at the caller's risk and is not exported here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStats ¶
type MemoryStats struct {
HeapAlloc uint64
HeapSys uint64
HeapIdle uint64
HeapInuse uint64
StackInuse uint64
StackSys uint64
MSpanInuse uint64
MCacheInuse uint64
GCCPUFraction float64
NumGC uint32
LastGC time.Time
PauseNs []time.Duration
NumGoroutines int
}
MemoryStats is a snapshot of process memory state at one moment in time.
func CollectMemoryStats ¶
func CollectMemoryStats() MemoryStats
CollectMemoryStats gathers the current heap/GC/goroutine snapshot. Intended for one-shot reporting at the end of a profiling run.
type Profile ¶
type Profile struct {
// contains filtered or unexported fields
}
Profile bundles the open files / pprof state for a profiling session. Returned by Start and passed to Stop. A zero Profile is safe to Stop (it's a no-op), which keeps the deferred-stop pattern clean even when Start failed partway.