resourcesmonitor

package
v2.24.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy