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

command

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package command profiles with any tool you can run: async-profiler for the JVM, perf, py-spy, rbspy, dotnet-trace, ... Each profile kind is a command run inside the service (through the runtime's exec) or on this machine against the service's pid; what it prints, or the file it writes, is the profile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(env core.Env, c *spec.Component) (any, error)

Types

type Kind

type Kind struct {
	// Command runs with {seconds}, {duration}, {pid} and {out} replaced.
	Command []string `yaml:"command"`
	// Where is "service" (exec inside the instance, the default) or "host" (this machine, for local runtimes).
	Where string `yaml:"where"`
	// Fetch, when set, runs after Command and its output is the profile (e.g. cat the file Command wrote).
	Fetch  []string `yaml:"fetch"`
	Format string   `yaml:"format"`
	Ext    string   `yaml:"ext"`
}

type Options

type Options struct {
	Kinds map[string]Kind `yaml:"kinds"`
	// PID is the target pid inside a container; most images run the service as pid 1.
	PID int `yaml:"pid"`
}

type Profiler

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

func (*Profiler) Capture

func (p *Profiler) Capture(ctx context.Context, r core.ProfileRequest) (core.Profile, error)

func (*Profiler) Kinds

func (p *Profiler) Kinds() []string

Jump to

Keyboard shortcuts

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