memoryprofile

package
v2026.1121.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Interval = 10 * time.Second
View Source
const ReportByteLimit = 16 * 1024
View Source
const SampleLimit = 60

Variables

View Source
var Default = New("")

Functions

This section is empty.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

func New

func New(home string) *Collector

func (*Collector) JSON

func (c *Collector) JSON() string

func (*Collector) Report

func (c *Collector) Report() Report

func (*Collector) Run

func (c *Collector) Run(ctx context.Context)

func (*Collector) Sample

func (c *Collector) Sample()

type Process

type Process struct {
	PID        int    `json:"pid"`
	Identity   string `json:"identity"`
	Executable string `json:"executable"`
	Kind       string `json:"kind"`
}

type Report

type Report struct {
	Scope                   string   `json:"scope"`
	ProcessMetricsAvailable bool     `json:"processMetricsAvailable"`
	IntervalSeconds         int      `json:"intervalSeconds"`
	PeakRSS                 uint64   `json:"peakObservedRSSBytes"`
	Samples                 []Sample `json:"samples"`
}

func (Report) BoundedJSON

func (r Report) BoundedJSON(limit int) (string, error)

type Sample

type Sample struct {
	AgeSeconds  int64  `json:"ageSeconds"`
	Server      Usage  `json:"server"`
	Desktop     Usage  `json:"desktop"`
	WebKit      Usage  `json:"webkit"`
	Heap        uint64 `json:"goHeapBytes"`
	HeapObjects uint64 `json:"goHeapObjects"`
	GC          uint32 `json:"goGCCount"`
}

type Usage

type Usage struct {
	Processes int    `json:"processes"`
	RSS       uint64 `json:"rssBytes"`
	Swap      uint64 `json:"swapBytes"`
}

Jump to

Keyboard shortcuts

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