profiler

package
v0.29.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoProfiler

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

func New

func New(log zerolog.Logger, uploader Uploader, cfg ProfilerConfig) (*AutoProfiler, error)

New creates a new AutoProfiler instance performing profiling every interval for duration.

func (*AutoProfiler) Done

func (p *AutoProfiler) Done() <-chan struct{}

func (*AutoProfiler) Enabled

func (p *AutoProfiler) Enabled() bool

Enabled returns the current enabled state of the profiler.

func (*AutoProfiler) Ready

func (p *AutoProfiler) Ready() <-chan struct{}

func (*AutoProfiler) SetEnabled

func (p *AutoProfiler) SetEnabled(enabled bool) error

SetEnabled sets whether the profiler is active. No errors are expected during normal operation.

func (*AutoProfiler) TriggerRun

func (p *AutoProfiler) TriggerRun(d time.Duration) error

TriggerRun manually triggers a profile run if one is not already running.

type NoopUploader

type NoopUploader struct{}

func (*NoopUploader) Upload

func (u *NoopUploader) Upload(ctx context.Context, filename string, pt pb.ProfileType) error

type Params

type Params struct {
	ProjectID string
	ChainID   string
	Role      string
	Version   string
	Commit    string
	Instance  string
}

type ProfilerConfig

type ProfilerConfig struct {
	Enabled         bool
	UploaderEnabled bool

	Dir      string
	Interval time.Duration
	Duration time.Duration
}

ProfilerConfig profiler parameters.

type Uploader

type Uploader interface {
	Upload(ctx context.Context, filename string, pt pb.ProfileType) error
}

func NewUploader

func NewUploader(log zerolog.Logger, params Params, opts ...option.ClientOption) (Uploader, error)

type UploaderImpl

type UploaderImpl struct {
	ProjectId  string
	Deployment *pb.Deployment
	// contains filtered or unexported fields
}

func (*UploaderImpl) Upload

func (u *UploaderImpl) Upload(ctx context.Context, filename string, pt pb.ProfileType) error

Jump to

Keyboard shortcuts

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