Documentation
¶
Index ¶
- Constants
- func CaptureShutdownProfileIfRequested(ctx context.Context, log logr.Logger) error
- func CaptureStartupProfileIfRequested(ctx context.Context, log logr.Logger) error
- func StartProfiling(ctx context.Context, ctxCancel context.CancelFunc, pt ProfileType, ...) error
- func WaitProfilingComplete()
- type ProfileType
Constants ¶
View Source
const (
// Environment variable that enables performance trace capture.
DCP_PERF_TRACE = "DCP_PERF_TRACE"
)
Variables ¶
This section is empty.
Functions ¶
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" )
Click to show internal directories.
Click to hide internal directories.