memorymonitor

package
v0.72.4 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package memorymonitor includes memory monitors and controllers based on cgroup data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryController

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

MemoryController describes a cgroup based memory controller

func NewMemoryController

func NewMemoryController(kind string, containerized bool, monitors ...MemoryMonitor) (*MemoryController, error)

NewMemoryController creates a new systemd cgroup based memory controller

func (*MemoryController) Start

func (mc *MemoryController) Start()

Start listening for events

func (*MemoryController) Stop

func (mc *MemoryController) Stop()

Stop the memory controller

type MemoryMonitor

type MemoryMonitor func(cgroup cgroupsv1.Cgroup) (cgroupsv1.MemoryEvent, func(), error)

MemoryMonitor creates a cgroup memory event

func MemoryPercentageThresholdMonitor

func MemoryPercentageThresholdMonitor(cb func(), percentage uint64, swap bool) MemoryMonitor

MemoryPercentageThresholdMonitor monitors memory usage above a specified percentage threshold

func MemoryPressureMonitor

func MemoryPressureMonitor(cb func(), level string) MemoryMonitor

MemoryPressureMonitor monitors memory pressure levels

func MemoryThresholdMonitor

func MemoryThresholdMonitor(cb func(), limit uint64, swap bool) MemoryMonitor

MemoryThresholdMonitor monitors memory usage above a specified threshold

Jump to

Keyboard shortcuts

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