profiling

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package profiling provides memory profiling utilities for brfit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBytes

func FormatBytes(b uint64) string

FormatBytes formats bytes as a human-readable string.

func StartCPUProfile

func StartCPUProfile(filename string) (func(), error)

StartCPUProfile starts CPU profiling to the specified file. Returns a stop function that should be called to stop profiling.

func WriteHeapProfile

func WriteHeapProfile(filename string) error

WriteHeapProfile writes a heap profile to the specified file.

Types

type MemoryStats

type MemoryStats struct {
	// Alloc is bytes of allocated heap objects.
	Alloc uint64

	// TotalAlloc is cumulative bytes allocated for heap objects.
	TotalAlloc uint64

	// Sys is total bytes of memory obtained from the OS.
	Sys uint64

	// NumGC is the number of completed GC cycles.
	NumGC uint32

	// GoroutineCount is the number of goroutines.
	GoroutineCount int

	// HeapObjects is the number of allocated heap objects.
	HeapObjects uint64
}

MemoryStats holds memory usage information.

func GetMemoryStats

func GetMemoryStats() MemoryStats

GetMemoryStats returns current memory statistics.

Jump to

Keyboard shortcuts

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