memwatch

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

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

Monitor allows making statements about the memory ratio used by the application

func NewMonitor

func NewMonitor(profiler memProfiler, limitSetter limitSetter, rate int) *Monitor

NewMonitor creates a Monitor with the given profiler, limitsetter and rate.

Typically this would be called with runtime.MemProfile, debug.SetMemoryLimit, and runtime.MemProfileRate

func (*Monitor) Ratio

func (m *Monitor) Ratio() float64

inspired by runtime/pprof/pprof.go

Jump to

Keyboard shortcuts

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