Help us shape the future of Go! Take the 2026 Go Developer Survey

flightrec

package
v1.3.104 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package flightrec pkg/flightrec/flightrec.go c1-util-debug

A process-wide execution-trace flight recorder (runtime/trace): it keeps the last few seconds of trace in memory, so a stall that is over before anyone looks can still be seen. A detector calls Snapshot when it notices one, and Handler serves the current window on demand.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler() http.Handler

Handler serves the current window as a trace file for `go tool trace`. The window is buffered first so a slow client cannot hold Stop up.

func Running

func Running() bool

Running reports whether the recorder is on.

func Snapshot

func Snapshot(reason string)

Snapshot saves the current window to a file named for reason, at most once a minute, in the background so the caller is never held. It keeps the last few files.

func Snapshots

func Snapshots() []string

Snapshots lists the saved snapshot files, newest first.

func Start

func Start(snapDir string, log func(string, ...any)) error

Start runs the recorder, saving snapshots into snapDir. Calling it again while it runs only changes the directory.

func Stop

func Stop()

Stop ends the recorder.

Types

This section is empty.

Jump to

Keyboard shortcuts

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