startupprofile

package
v0.0.0-...-9d1caa8 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package startupprofile provides opt-in diagnostics for application startup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(ctx context.Context, profiler *Profiler) context.Context

Context attaches profiler to ctx.

Types

type Profiler

type Profiler struct {
	// contains filtered or unexported fields
}

Profiler records startup milestones and owns optional runtime profiles.

func FromContext

func FromContext(ctx context.Context) *Profiler

FromContext returns the attached profiler or nil.

func Start

func Start() (*Profiler, error)

Start creates diagnostics configured through LIBRECODE_STARTUP_* environment variables.

func (*Profiler) FirstFrame

func (profiler *Profiler) FirstFrame() error

FirstFrame records the first completed visible frame and finalizes startup profiles.

func (*Profiler) Mark

func (profiler *Profiler) Mark(name string)

Mark records an instantaneous startup milestone.

func (*Profiler) Span

func (profiler *Profiler) Span(name string) func()

Span records a timed startup stage. The returned function must be called once.

func (*Profiler) Stop

func (profiler *Profiler) Stop() error

Stop finalizes active runtime profiles when startup exits before its first frame.

Jump to

Keyboard shortcuts

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