node

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StatsQueryMaxRetries  = 3
	StatsQuerySleepPeriod = 3 * time.Second
	PortsQueryTimeout     = 5 * time.Second
)

Functions

This section is empty.

Types

type Node

type Node struct {
	Address         string // host:port
	Cores           int    // logical CPUs reported by the worker
	Memory          int64  // total memory in KB
	Disk            int64  // total disk in bytes
	MemoryAllocated int64  // bytes reserved by the worker's running tasks
	Stats           stats.Stats
	Role            string
	// contains filtered or unexported fields
}

func New

func New(address, role string) (*Node, error)

func (*Node) ClearStats

func (n *Node) ClearStats()

func (*Node) GetPorts

func (n *Node) GetPorts() (*worker.OccupiedPorts, error)

func (*Node) GetStats

func (n *Node) GetStats() (*stats.Stats, error)

func (*Node) HasStats

func (n *Node) HasStats() bool

func (*Node) Reachable

func (n *Node) Reachable() bool

func (*Node) Snapshot

func (n *Node) Snapshot() Snapshot

type Snapshot

type Snapshot struct {
	Cores            int
	MemoryTotalKB    int64
	MemUsedKB        int64
	MemoryAllocatedB int64
	DiskFreeB        int64
	CpuUsage         float64
	TaskCount        int
}

a concurrency-safe point-in-time copy of the resource fields

Jump to

Keyboard shortcuts

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