resourcesmonitor

package
v2.38.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: AGPL-3.0 Imports: 8 Imported by: 1 module, 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

This section is empty.

Variables

This section is empty.

Functions

func NewFetcher

func NewFetcher(f Statter) (*fetcher, error)

func NewResourcesMonitor

func NewResourcesMonitor(logger slog.Logger, clock quartz.Clock, config *proto.GetResourcesMonitoringConfigurationResponse, resourcesFetcher Fetcher, datapointsPusher datapointsPusher) *monitor

Types

type Datapoint

type Datapoint struct {
	CollectedAt time.Time
	Memory      *MemoryDatapoint
	Volumes     []*VolumeDatapoint
}

type Fetcher

type Fetcher interface {
	FetchMemory() (total int64, used int64, err error)
	FetchVolume(volume string) (total int64, used int64, err error)
}

type MemoryDatapoint

type MemoryDatapoint struct {
	Total int64
	Used  int64
}

type Queue

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

Queue represents a FIFO queue with a fixed size

func NewQueue

func NewQueue(size int) *Queue

newQueue creates a new Queue with the given size

func (*Queue) IsFull

func (q *Queue) IsFull() bool

func (*Queue) Items

func (q *Queue) Items() []Datapoint

func (*Queue) ItemsAsProto

func (*Queue) Push

func (q *Queue) Push(item Datapoint)

Push adds a new item to the queue

type Statter added in v2.21.0

type Statter interface {
	IsContainerized() (bool, error)
	ContainerMemory(p clistat.Prefix) (*clistat.Result, error)
	HostMemory(p clistat.Prefix) (*clistat.Result, error)
	Disk(p clistat.Prefix, path string) (*clistat.Result, error)
}

type VolumeDatapoint

type VolumeDatapoint struct {
	Path  string
	Total int64
	Used  int64
}

Jump to

Keyboard shortcuts

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