profiler

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package profiler offers functions to profile the execution of a process using go's built-in profiling tools

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUConfig

type CPUConfig struct {
	Enabled  bool
	FileName string
}

CPUConfig defines the configuration of a CPU profiling probe

type Config

type Config struct {
	CPU     CPUConfig
	Memory  MemoryConfig
	Metrics MetricsConfig
	Trace   TraceConfig
}

Config is the configuration of the profiler

type MemoryConfig

type MemoryConfig struct {
	Enabled  bool
	FileName string
	Rate     int
}

MemoryConfig defines the configuration of a Memory profiling probe

type MetricsConfig

type MetricsConfig struct {
	Enabled  bool
	FileName string
	Rate     time.Duration
}

MetricsConfig defines the configuration of a metrics probe

type Probe

type Probe interface {
	Start() (io.Closer, error)
}

Probe defines the interface for controlling a profiling probe

func NewCPUProbe

func NewCPUProbe(config CPUConfig) (Probe, error)

NewCPUProbe creates a new CPU profiling probe

func NewMemoryProbe

func NewMemoryProbe(config MemoryConfig) (Probe, error)

NewMemoryProbe creates a memory profiling probe with the given configuration

func NewMetricsProbe

func NewMetricsProbe(config MetricsConfig) (Probe, error)

NewMetricsProbe creates a metrics profiling probe with the given configuration

func NewTraceProbe

func NewTraceProbe(config TraceConfig) (Probe, error)

NewTraceProbe creates a trace profiling probe with the given configuration

type Profiler

type Profiler interface {
	// Start stars the collection of profiling information with the given configuration
	Start(config Config) (io.Closer, error)
}

Profiler defines the methods to control execution profiling

func NewProfiler

func NewProfiler() Profiler

NewProfiler creates a Profiler instance

type TraceConfig

type TraceConfig struct {
	Enabled  bool
	FileName string
}

TraceConfig defines the configuration of a tracing probe

Jump to

Keyboard shortcuts

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