profile

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package profile provides runtime profiling helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPUProfile

func CPUProfile(path string) (func(), error)

CPUProfile starts CPU profiling to the given file.

func Format

func Format(s Stats) string

Format returns formatted runtime stats.

func GoroutineProfile

func GoroutineProfile(path string) error

GoroutineProfile writes a goroutine profile to the given file.

func MemoryProfile

func MemoryProfile(path string) error

MemoryProfile writes a heap profile to the given file.

Types

type Stats

type Stats struct {
	NumGoroutine  int    `json:"num_goroutine"`
	NumCPU        int    `json:"num_cpu"`
	MemAlloc      uint64 `json:"mem_alloc"`
	MemTotalAlloc uint64 `json:"mem_total_alloc"`
	MemSys        uint64 `json:"mem_sys"`
	MemNumGC      uint32 `json:"mem_num_gc"`
	Timestamp     int64  `json:"timestamp"`
}

Stats returns runtime statistics.

func GetStats

func GetStats() Stats

GetStats returns current runtime statistics.

Jump to

Keyboard shortcuts

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