driver

package
v0.0.0-...-556e816 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Package driver implements the core pprof functionality. It can be parameterized with a flag implementation, fetch and symbolize mechanisms.

Index

Constants

This section is empty.

Variables

View Source
var DataStoreEndpoint string
View Source
var FlagNoDataStore = false
View Source
var GhOrg = "HdrHistogram"
View Source
var GhRepo = "hdrhistogram-go"
View Source
var GitHash = "494271c4c016b36c8cee88480288f33b419cf7b0"

Functions

func AddCommand

func AddCommand(cmd string, format int, post PostProcessor, desc, usage string)

AddCommand adds an additional command to the set of commands accepted by pprof. This enables extensions to add new commands for specialized visualization formats. If the command specified already exists, it is overwritten.

func ArticleHandler

func ArticleHandler(w http.ResponseWriter, r *http.Request)

func GenerateRawReport

func GenerateRawReport(p *profile.Profile, cmd []string, cfg PprofConfig, o *plugin.Options) (*command, *report.Report, error)

func PProf

func PProf(eo *plugin.Options) error

PProf acquires a profile, and symbolizes it using a profile manager. Then it generates a report formatted according to the options selected through the flags package.

func SetVariableDefault

func SetVariableDefault(variable, value string)

SetVariableDefault sets the default value for a pprof variable. This enables extensions to set their own defaults.

Types

type GoFlags

type GoFlags struct {
	UsageMsgs []string
}

GoFlags implements the plugin.FlagSet interface.

func (*GoFlags) AddExtraUsage

func (f *GoFlags) AddExtraUsage(eu string)

AddExtraUsage implements the plugin.FlagSet interface.

func (*GoFlags) Bool

func (*GoFlags) Bool(o string, d bool, c string) *bool

Bool implements the plugin.FlagSet interface.

func (*GoFlags) ExtraUsage

func (f *GoFlags) ExtraUsage() string

ExtraUsage implements the plugin.FlagSet interface.

func (*GoFlags) Float64

func (*GoFlags) Float64(o string, d float64, c string) *float64

Float64 implements the plugin.FlagSet interface.

func (*GoFlags) Int

func (*GoFlags) Int(o string, d int, c string) *int

Int implements the plugin.FlagSet interface.

func (*GoFlags) Parse

func (*GoFlags) Parse(usage func()) []string

Parse implements the plugin.FlagSet interface.

func (*GoFlags) String

func (*GoFlags) String(o, d, c string) *string

String implements the plugin.FlagSet interface.

func (*GoFlags) StringList

func (*GoFlags) StringList(o, d, c string) *[]*string

StringList implements the plugin.FlagSet interface.

type PostProcessor

type PostProcessor func(input io.Reader, output io.Writer, ui plugin.UI) error

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

type PprofConfig

type PprofConfig struct {
	// Filename for file-based output formats, stdout by default.
	Output string `json:"-"`

	// Display options.
	CallTree            bool    `json:"call_tree,omitempty"`
	RelativePercentages bool    `json:"relative_percentages,omitempty"`
	Unit                string  `json:"unit,omitempty"`
	CompactLabels       bool    `json:"compact_labels,omitempty"`
	SourcePath          string  `json:"-"`
	TrimPath            string  `json:"-"`
	IntelSyntax         bool    `json:"intel_syntax,omitempty"`
	Mean                bool    `json:"mean,omitempty"`
	SampleIndex         string  `json:"-"`
	DivideBy            float64 `json:"-"`
	Normalize           bool    `json:"normalize,omitempty"`
	Sort                string  `json:"sort,omitempty"`

	// Filtering options
	DropNegative bool    `json:"drop_negative,omitempty"`
	NodeCount    int     `json:"nodecount,omitempty"`
	NodeFraction float64 `json:"nodefraction,omitempty"`
	EdgeFraction float64 `json:"edgefraction,omitempty"`
	Trim         bool    `json:"trim,omitempty"`
	Focus        string  `json:"focus,omitempty"`
	Ignore       string  `json:"ignore,omitempty"`
	PruneFrom    string  `json:"prune_from,omitempty"`
	Hide         string  `json:"hide,omitempty"`
	Show         string  `json:"show,omitempty"`
	ShowFrom     string  `json:"show_from,omitempty"`
	TagFocus     string  `json:"tagfocus,omitempty"`
	TagIgnore    string  `json:"tagignore,omitempty"`
	TagShow      string  `json:"tagshow,omitempty"`
	TagHide      string  `json:"taghide,omitempty"`
	NoInlines    bool    `json:"noinlines,omitempty"`

	// Output granularity
	Granularity string `json:"granularity,omitempty"`
}

PprofConfig holds settings for a single named PprofConfig. The JSON tag name for a field is used both for JSON encoding and as a named variable.

func DefaultConfig

func DefaultConfig() PprofConfig

DefaultConfig returns the default configuration values; it is unaffected by flags and interactive assignments.

Jump to

Keyboard shortcuts

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