profiler

package
v0.1.149 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package profiler provides profiling support for the application using github.com/pkg/profile. It supports various profiling modes including CPU, memory, allocations, heap, mutex, block, and trace.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir() string

Dir returns the directory where profile artifacts were written, or empty string if profiling disabled.

func Mode

func Mode() string

Mode returns the active profiling mode or empty string if disabled.

func Start

func Start(cfg Config) (stop func(), err error)

Start initializes profiling based on the provided configuration. Returns a stop function that must be called to finalize profiling, and an error if initialization fails. The stop function is safe to call even if profiling was not started.

Types

type Config

type Config struct {
	// Mode specifies the profiling mode: cpu, mem, allocs, heap, mutex, block, trace.
	// Empty string disables profiling.
	Mode string
}

Config holds profiling configuration.

Jump to

Keyboard shortcuts

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