monitor

package
v0.0.0-...-99c2a2b Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const BufferSize = 32

Variables

This section is empty.

Functions

func Average

func Average(nums []float64) float64

Types

type Asset

type Asset interface {
	Name() string
	SampleMetrics()
	AggregateMetrics() map[string]float64
	ClearMetrics()
	IsAvailable() bool
	Probe() *service.MetadataRequest
}

type Buffer

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

Buffer is the in-memory metrics buffer for the system monitor

func NewBuffer

func NewBuffer(maxSize int32) *Buffer

type CPU

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

func NewCPU

func NewCPU(settings *service.Settings) *CPU

func (*CPU) AggregateMetrics

func (c *CPU) AggregateMetrics() map[string]float64

func (*CPU) ClearMetrics

func (c *CPU) ClearMetrics()

func (*CPU) IsAvailable

func (c *CPU) IsAvailable() bool

func (*CPU) Name

func (c *CPU) Name() string

func (*CPU) Probe

func (c *CPU) Probe() *service.MetadataRequest

func (*CPU) SampleMetrics

func (c *CPU) SampleMetrics()

type Disk

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

func NewDisk

func NewDisk(settings *service.Settings) *Disk

func (*Disk) AggregateMetrics

func (d *Disk) AggregateMetrics() map[string]float64

func (*Disk) ClearMetrics

func (d *Disk) ClearMetrics()

func (*Disk) IsAvailable

func (d *Disk) IsAvailable() bool

func (*Disk) Name

func (d *Disk) Name() string

func (*Disk) Probe

func (d *Disk) Probe() *service.MetadataRequest

func (*Disk) SampleMetrics

func (d *Disk) SampleMetrics()

type GPUNvidia

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

func NewGPUNvidia

func NewGPUNvidia(settings *service.Settings) *GPUNvidia

func (*GPUNvidia) AggregateMetrics

func (g *GPUNvidia) AggregateMetrics() map[string]float64

func (*GPUNvidia) ClearMetrics

func (g *GPUNvidia) ClearMetrics()

func (*GPUNvidia) Close

func (g *GPUNvidia) Close()

func (*GPUNvidia) IsAvailable

func (g *GPUNvidia) IsAvailable() bool

func (*GPUNvidia) Name

func (g *GPUNvidia) Name() string

func (*GPUNvidia) Probe

func (g *GPUNvidia) Probe() *service.MetadataRequest

func (*GPUNvidia) SampleMetrics

func (g *GPUNvidia) SampleMetrics()

type List

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

func (*List) Append

func (l *List) Append(element Measurement)

func (*List) GetElements

func (l *List) GetElements() []Measurement

type Measurement

type Measurement struct {
	// timestamp of the measurement
	Timestamp *timestamppb.Timestamp
	// value of the measurement
	Value float64
}

type Memory

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

func NewMemory

func NewMemory(settings *service.Settings) *Memory

func (*Memory) AggregateMetrics

func (m *Memory) AggregateMetrics() map[string]float64

func (*Memory) ClearMetrics

func (m *Memory) ClearMetrics()

func (*Memory) IsAvailable

func (m *Memory) IsAvailable() bool

func (*Memory) Name

func (m *Memory) Name() string

func (*Memory) Probe

func (m *Memory) Probe() *service.MetadataRequest

func (*Memory) SampleMetrics

func (m *Memory) SampleMetrics()

type Network

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

func NewNetwork

func NewNetwork(settings *service.Settings) *Network

func (*Network) AggregateMetrics

func (n *Network) AggregateMetrics() map[string]float64

func (*Network) ClearMetrics

func (n *Network) ClearMetrics()

func (*Network) IsAvailable

func (n *Network) IsAvailable() bool

func (*Network) Name

func (n *Network) Name() string

func (*Network) Probe

func (n *Network) Probe() *service.MetadataRequest

func (*Network) SampleMetrics

func (n *Network) SampleMetrics()

type SystemMonitor

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

func NewSystemMonitor

func NewSystemMonitor(
	settings *service.Settings,
	logger *observability.NexusLogger,
	outChan chan *service.Record,
) *SystemMonitor

NewSystemMonitor creates a new SystemMonitor with the given settings

func (*SystemMonitor) Do

func (sm *SystemMonitor) Do()

func (*SystemMonitor) GetBuffer

func (sm *SystemMonitor) GetBuffer() map[string]List

func (*SystemMonitor) Monitor

func (sm *SystemMonitor) Monitor(asset Asset)

func (*SystemMonitor) Probe

func (sm *SystemMonitor) Probe() *service.MetadataRequest

func (*SystemMonitor) Stop

func (sm *SystemMonitor) Stop()

Jump to

Keyboard shortcuts

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