debug

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachSlowTickLogger

func AttachSlowTickLogger(srv *golem.Server, opts SlowTickLoggerOptions)

AttachSlowTickLogger logs slow ticks and periodic rolling wall-time samples.

func AttachTickProfiler

func AttachTickProfiler(srv *golem.Server, opts TickProfilerOptions)

AttachTickProfiler labels pprof samples by tick and optionally wraps each tick in a runtime/trace region.

func StartPprof

func StartPprof(addr string) error

StartPprof starts a pprof debug HTTP server on addr (e.g. "127.0.0.1:6060"). All pprof handlers are mounted on a dedicated ServeMux so http.DefaultServeMux is not affected. Call from main when a debug flag is set; never import this package in production binaries.

Types

type SlowTickLoggerOptions

type SlowTickLoggerOptions struct {
	Budget        time.Duration
	Interval      time.Duration
	Window        int
	Logf          func(format string, args ...any)
	MessagePrefix string
}

SlowTickLoggerOptions configures AttachSlowTickLogger.

type TickProfilerOptions

type TickProfilerOptions struct {
	Context context.Context
	Trace   bool
}

TickProfilerOptions configures AttachTickProfiler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL