pprof

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader, p *tree.Profile) error

func DecodePool

func DecodePool(r io.Reader, fn func(*tree.Profile) error) error

Types

type Parser added in v0.19.0

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

func NewParser added in v0.19.0

func NewParser(config ParserConfig) *Parser

func (*Parser) Convert added in v0.19.0

func (p *Parser) Convert(ctx context.Context, startTime, endTime time.Time, profile *tree.Profile) error

func (*Parser) ParsePprof added in v0.19.0

func (p *Parser) ParsePprof(ctx context.Context, startTime, endTime time.Time, b io.Reader) error

func (*Parser) Reset added in v0.19.0

func (p *Parser) Reset()

type ParserConfig added in v0.19.0

type ParserConfig struct {
	Putter        storage.Putter
	SpyName       string
	Labels        map[string]string
	SkipExemplars bool
	SampleTypes   map[string]*tree.SampleTypeConfig
}

type RawProfile added in v0.19.0

type RawProfile struct {

	// Initializes lazily on Bytes, if not present.
	RawData             []byte // Represents raw request body as per ingestion API.
	FormDataContentType string // Set optionally, if RawData is multipart form.
	// Initializes lazily on Parse, if not present.
	Profile          []byte // Represents raw pprof data.
	PreviousProfile  []byte // Used for cumulative type only.
	SkipExemplars    bool
	SampleTypeConfig map[string]*tree.SampleTypeConfig
	// contains filtered or unexported fields
}

func (*RawProfile) Bytes added in v0.19.0

func (p *RawProfile) Bytes() ([]byte, error)

func (*RawProfile) ContentType added in v0.19.0

func (p *RawProfile) ContentType() string

func (*RawProfile) Parse added in v0.19.0

func (*RawProfile) Push added in v0.19.0

func (p *RawProfile) Push(profile []byte, cumulative bool) *RawProfile

Push loads data from profile to RawProfile making it eligible for Bytes and Parse calls.

Returned RawProfile should be used at the next Push: the method established relationship between these two RawProfiles in order to propagate internal pprof parser state lazily on a successful Parse call. This is necessary for cumulative profiles that require two consecutive samples to calculate the diff. If parser is not present due to a failure, or sequence violation, the profiles will be re-parsed.

Jump to

Keyboard shortcuts

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