pprof

package
v0.0.0-...-636a2a8 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package pprof provides pprof supports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	ProjectID   string
	DialOptions []grpc.DialOption
}

Options is a profile uploader option.

type Profile

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

Profile is a profile entry.

func New

func New(name string) *Profile

New creates new profile for the name.

func (*Profile) Add

func (p *Profile) Add(d time.Duration, backtraces []string)

Add adds new duration for the backtraces.

func (*Profile) AddComment

func (p *Profile) AddComment(c string)

AddComment adds a comment to the profile.

func (*Profile) Duration

func (p *Profile) Duration() time.Duration

Duration returns duration of the profile.

func (*Profile) Name

func (p *Profile) Name() string

Name returns name of the profile.

func (*Profile) WriteTo

func (p *Profile) WriteTo(w io.Writer, debug int) error

WriteTo writes profile to w, as https://pkg.go.dev/runtime/pprof#Profile.WriteTo not https://pkg.go.dev/io#WriterTo.

type Uploader

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

Uploader is a profile uploader.

func NewUploader

func NewUploader(ctx context.Context, opts Options) (*Uploader, error)

NewUploader creates new profile uploader.

func (*Uploader) SetMetadata

func (u *Uploader) SetMetadata(ctx context.Context, metadata metadata.Metadata)

SetMetadata sets metadata to the uploader.

func (*Uploader) Upload

func (u *Uploader) Upload(ctx context.Context, p *Profile) error

Upload uploads a profile.

Directories

Path Synopsis
Package proto provides protocol buffer message for profiler.
Package proto provides protocol buffer message for profiler.

Jump to

Keyboard shortcuts

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