profiling

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProfileEndpoints = [...]string{
	ProfileTypeUnknown:      "",
	ProfileTypeHeap:         "heap",
	ProfileTypeProfile:      "profile",
	ProfileTypeBlock:        "block",
	ProfileTypeTrace:        "trace",
	ProfileTypeAllocs:       "allocs",
	ProfileTypeMutex:        "mutex",
	ProfileTypeGoroutine:    "goroutine",
	ProfileTypeThreadCreate: "threadcreate",
}

ProfileEndpoints array maps ProfileType to the string endpoint for pprof

Functions

func NewProfilingCommand

func NewProfilingCommand(p *pkg.AdminParams) *cobra.Command

NewProfilingCommand creates a profiling command

Types

type DownloadOptions

type DownloadOptions interface {
	Apply(*http.Request) error
}

DownloadOptions interface to manipulate the http request to pprof server

type Downloader

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

Downloader struct holds all private fields

func (*Downloader) Download

func (d *Downloader) Download(t ProfileType, output io.Writer, options ...DownloadOptions) error

Download specific type of profile with options

type OptionProfilingTime

type OptionProfilingTime time.Duration

OptionProfilingTime is option to add a seconds param in the http request

func (OptionProfilingTime) Apply

func (pr OptionProfilingTime) Apply(req *http.Request) error

Apply implements DownloadOptions interface for type ProfilingTime

type ProfileDownloader

type ProfileDownloader interface {
	Download(ProfileType, io.Writer, ...DownloadOptions) error
}

ProfileDownloader interface for profile downloader

func NewDownloader

func NewDownloader(cfgGetter RestConfigGetter, podName, namespace string, endCh <-chan struct{}) (ProfileDownloader, error)

NewDownloader returns the profiling downloader and setup connections asynchronously

type ProfileType

type ProfileType int

ProfileType enums for all supported profiles

const (
	ProfileTypeUnknown ProfileType = iota
	ProfileTypeHeap
	ProfileTypeProfile
	ProfileTypeBlock
	ProfileTypeTrace
	ProfileTypeAllocs
	ProfileTypeMutex
	ProfileTypeGoroutine
	ProfileTypeThreadCreate
)

type RestConfigGetter

type RestConfigGetter interface {
	RestConfig() (*rest.Config, error)
}

RestConfigGetter interface to get restconfig

Jump to

Keyboard shortcuts

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