pprofutil

package
v0.0.0-...-92baf9f Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseProfileFrom

func ParseProfileFrom(r io.Reader) (*pprofProfile.Profile, error)

func ProfilesEqual

func ProfilesEqual(pp1, pp2 *pprofProfile.Profile) bool

ProfilesEqual is a test helper that checks whether two profiles equal.

func SampleAddLabel

func SampleAddLabel(s *pprofProfile.Sample, key, valueStr string, valueNum int64)

SampleAddLabel adds a key-value pair to the sample. Note that, non-empty valueStr take precedence over valueNum.

Types

type ProfileBuilder

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

func NewProfileBuilder

func NewProfileBuilder(ptyp profile.ProfileType) *ProfileBuilder

func (*ProfileBuilder) AddFunction

func (pb *ProfileBuilder) AddFunction(fn *pprofProfile.Function)

func (*ProfileBuilder) AddLocation

func (pb *ProfileBuilder) AddLocation(loc *pprofProfile.Location)

func (*ProfileBuilder) AddMapping

func (pb *ProfileBuilder) AddMapping(m *pprofProfile.Mapping)

func (*ProfileBuilder) AddSample

func (pb *ProfileBuilder) AddSample(s *pprofProfile.Sample)

func (*ProfileBuilder) Build

func (pb *ProfileBuilder) Build() (*pprofProfile.Profile, error)

func (*ProfileBuilder) IsEmpty

func (pb *ProfileBuilder) IsEmpty() bool

type ProfileParser

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

func NewProfileParser

func NewProfileParser(data []byte) *ProfileParser

func (*ProfileParser) ParseProfile

func (pr *ProfileParser) ParseProfile() (prof *pprofProfile.Profile, err error)

func (*ProfileParser) Read

func (pr *ProfileParser) Read(p []byte) (n int, err error)

func (*ProfileParser) Seek

func (pr *ProfileParser) Seek(offset int64, whence int) (int64, error)

func (*ProfileParser) WriteTo

func (pr *ProfileParser) WriteTo(w io.Writer) (n int64, err error)

type ProfileParserError

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

func (*ProfileParserError) Error

func (e *ProfileParserError) Error() string

func (*ProfileParserError) Unwrap

func (e *ProfileParserError) Unwrap() error

Jump to

Keyboard shortcuts

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