perftrace

package
v0.22.6 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Environment variable that enables performance trace capture.
	DCP_PERF_TRACE = "DCP_PERF_TRACE"
)

Variables

This section is empty.

Functions

func CaptureShutdownProfileIfRequested

func CaptureShutdownProfileIfRequested(ctx context.Context, log logr.Logger) error

func CaptureStartupProfileIfRequested

func CaptureStartupProfileIfRequested(ctx context.Context, log logr.Logger) error

func StartProfiling

func StartProfiling(ctx context.Context, ctxCancel context.CancelFunc, pt ProfileType, log logr.Logger) error

Starts profiling the current process till the passed-in context is cancelled. The profileType parameter is used as part of the profile data file name, to make it easier to identify the correct profile.

func WaitProfilingComplete

func WaitProfilingComplete()

Waits for any outstanding profiling requests to complete before exiting the program. Otherwise the profiling data may not be written to disk. Not necessary in dcp.exe due to the way profiling is handled there, but useful for dcpctrl and potentially other executables that may use profiling.

Types

type ProfileType

type ProfileType string
const (
	ProfileTypeStartup     ProfileType = "startup"
	ProfileTypeShutdown    ProfileType = "shutdown"
	ProfileTypeSnapshot    ProfileType = "snapshot"
	ProfileTypeStartupCpu  ProfileType = "startup-cpu"
	ProfileTypeShutdownCpu ProfileType = "shutdown-cpu"
	ProfileTypeSnapshotCpu ProfileType = "snapshot-cpu"
)

Jump to

Keyboard shortcuts

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