profiler

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EfficientBuffer added in v0.13.0

type EfficientBuffer []byte

func (*EfficientBuffer) PutInt16 added in v0.13.0

func (eb *EfficientBuffer) PutInt16(v int16)

PutInt16 writes the passed int16 in little endian and advances the current slice.

func (*EfficientBuffer) PutUint16 added in v0.13.0

func (eb *EfficientBuffer) PutUint16(v uint16)

PutUint16 writes the passed uint16 in little endian and advances the current slice.

func (*EfficientBuffer) PutUint32 added in v0.13.0

func (eb *EfficientBuffer) PutUint32(v uint32)

PutUint32 writes the passed uint32 in little endian and advances the current slice.

func (*EfficientBuffer) PutUint64 added in v0.13.0

func (eb *EfficientBuffer) PutUint64(v uint64)

PutUint64 writes the passed uint64 in little endian and advances the current slice.

func (*EfficientBuffer) PutUint8 added in v0.13.0

func (eb *EfficientBuffer) PutUint8(v uint8)

PutUint8 writes the passed uint8 in little endian and advances the current slice.

func (*EfficientBuffer) Slice added in v0.13.0

func (eb *EfficientBuffer) Slice(size int) EfficientBuffer

Slice returns a slice re-sliced from the original EfficientBuffer. This is useful to efficiently write byte by byte, for example, when setting BPF maps without incurring in extra allocations in the writing methods, or changing the capacity of the underlying memory buffer.

Callers are responsible to ensure that there is enough capacity left for the passed size.

type FileStore added in v0.20.0

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

FileStore writes profiles to a local file.

func NewFileStore added in v0.20.0

func NewFileStore(dirPath string) *FileStore

NewFileStore creates a new FileProfileWriter.

func (*FileStore) Store added in v0.20.0

type NoopProfiler added in v0.10.0

type NoopProfiler struct{}

NoopProfiler does nothing. It serves as a skeleton of what other will have to be implemented when adding a new profiler.

func (*NoopProfiler) LastError added in v0.10.0

func (p *NoopProfiler) LastError() error

func (*NoopProfiler) LastProfileStartedAt added in v0.10.0

func (p *NoopProfiler) LastProfileStartedAt() time.Time

func (*NoopProfiler) Name added in v0.10.0

func (p *NoopProfiler) Name() string

func (*NoopProfiler) ProcessLastErrors added in v0.10.0

func (p *NoopProfiler) ProcessLastErrors() map[int]error

func (*NoopProfiler) Run added in v0.10.0

func (p *NoopProfiler) Run(_ context.Context) error

func (*NoopProfiler) Stop added in v0.10.0

func (p *NoopProfiler) Stop()

type PID added in v0.10.0

type PID int32

PID is the process ID of the profiling target. See https://ftp.gnu.org/old-gnu/Manuals/glibc-2.2.3/html_node/libc_554.html

type ProcessInfoManager added in v0.20.0

type ProcessInfoManager interface {
	Fetch(ctx context.Context, pid int) (process.Info, error)
	FetchWithFreshMappings(ctx context.Context, pid int) (process.Info, error)
	Info(ctx context.Context, pid int) (process.Info, error)
}

TODO: Unify PID types.

type ProfileStore added in v0.20.0

type ProfileStore interface {
	Store(ctx context.Context, labels model.LabelSet, wrt profile.Writer, executableInfo []*profilestorepb.ExecutableInfo) error
}

type RemoteStore added in v0.20.0

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

RemoteStore is a profile writer that writes profiles to a remote profile store.

func NewRemoteStore added in v0.20.0

func NewRemoteStore(logger log.Logger, profileStoreClient profilestorepb.ProfileStoreServiceClient) *RemoteStore

NewRemoteStore creates a new RemoteProfileWriter.

func (*RemoteStore) Store added in v0.20.0

Store sends the profile using the designated write client.

type StackID added in v0.10.0

type StackID struct {
	PID PID
	TID PID
}

StackID consists of two parts: the first part is the process ID of the profiling target, the second part is the thread ID of the stack trace has been collected from.

Directories

Path Synopsis
cpu
bpf
nolint: unused
nolint: unused
nolint: unused
nolint: unused

Jump to

Keyboard shortcuts

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