package commands

import "cmd/internal/pprof/commands"

Package commands defines and manages the basic pprof commands

Index

Types

type Command

type Command struct {
	Complete    Completer     // autocomplete for interactive mode
	Format      int           // report format to generate
	PostProcess PostProcessor // postprocessing to run on report
	HasParam    bool          // Collect a parameter from the CLI
	Usage       string        // Help text
}

Command describes the actions for a pprof command. Includes a function for command-line completion, the report format to use during report generation, any postprocessing functions, and whether the command expects a regexp parameter (typically a function name).

type Commands

type Commands map[string]*Command

Commands describes the commands accepted by pprof.

func PProf

func PProf(c Completer, interactive **bool) Commands

PProf returns the basic pprof report-generation commands

type Completer

type Completer func(prefix string) string

Completer is a function for command-line autocompletion

func NewCompleter

func NewCompleter(cs Commands) Completer

NewCompleter creates an autocompletion function for a set of commands.

type PostProcessor

type PostProcessor func(input *bytes.Buffer, output io.Writer, ui plugin.UI) error

PostProcessor is a function that applies post-processing to the report output

Source Files

commands.go

Version
v1.7.1
Published
Sep 7, 2016
Platform
linux/amd64
Imports
13 packages
Last checked
57 seconds ago

Tools for package owners.