core

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendType

type BackendType string

BackendType represents the type of profiling backend

const (
	PyroscopeBackend BackendType = "pyroscope"
	PprofBackend     BackendType = "pprof"
)

type LegacyType

type LegacyType string

LegacyType represents the type of profiler for backward compatibility

const (
	LegacyTypePyroscope LegacyType = "pyroscope"
	LegacyTypePprof     LegacyType = "pprof"
)

type ProfileType

type ProfileType string

ProfileType represents different types of profiles

const (
	ProfileCPU           ProfileType = "cpu"
	ProfileAllocObjects  ProfileType = "alloc_objects"
	ProfileAllocSpace    ProfileType = "alloc_space"
	ProfileInuseObjects  ProfileType = "inuse_objects"
	ProfileInuseSpace    ProfileType = "inuse_space"
	ProfileGoroutines    ProfileType = "goroutines"
	ProfileMutexCount    ProfileType = "mutex_count"
	ProfileMutexDuration ProfileType = "mutex_duration"
	ProfileBlockCount    ProfileType = "block_count"
	ProfileBlockDuration ProfileType = "block_duration"
)

type Profiler

type Profiler interface {
	// Start begins profiling
	Start(ctx context.Context) error

	// Stop gracefully stops profiling
	Stop(ctx context.Context) error

	// Pause temporarily stops profiling
	Pause(ctx context.Context) error

	// Resume after pause
	Resume(ctx context.Context) error

	// IsRunning returns the current state of the profiler
	IsRunning() bool

	// Name returns the profiler's identifier
	Name() string
}

Profiler defines the interface for profiling backends

type ProfilingState

type ProfilingState string

ProfilingState represents the initial state of profiling

const (
	ProfilingEnabled  ProfilingState = "enabled"
	ProfilingDisabled ProfilingState = "disabled"
)

type Tagger added in v1.3.0

type Tagger interface {
	// AddTag adds a key-value pair tag to the current profiling context
	AddTag(key, value string) error

	// TagWrapper executes a function with additional profiling tags
	// The tags are only applied during the execution of the function
	// The provided context is passed to the function
	TagWrapper(ctx context.Context, key, value string, fn func(context.Context) error) error
}

Tagger defines the interface for adding tags to profiles This abstracts away the specific backend implementation

Jump to

Keyboard shortcuts

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