capacity

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AskRequest

type AskRequest struct {
	Task       string            `json:"task"`
	Complexity int               `json:"complexity,omitempty"`
	Resources  *ResourceEstimate `json:"resources,omitempty"`
}

type AskResponse

type AskResponse struct {
	Allowed bool     `json:"allowed"`
	Reasons []string `json:"reasons,omitempty"`
}

type Manager

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

func NewManager

func NewManager(aggregator *monitor.Aggregator, thresholds config.ThresholdsConfig) *Manager

func (*Manager) Ask

func (m *Manager) Ask(req AskRequest, withReasons bool) AskResponse

func (*Manager) UpdateThresholds

func (m *Manager) UpdateThresholds(thresholds config.ThresholdsConfig)

type Reason

type Reason string
const (
	ReasonCPUOverload    Reason = "cpu_overload"
	ReasonMemoryOverload Reason = "memory_overload"
	ReasonGPUOverload    Reason = "gpu_overload"
	ReasonVRAMOverload   Reason = "vram_overload"
	ReasonStorageLow     Reason = "storage_low"
)

type ResourceEstimate

type ResourceEstimate struct {
	CPU    int `json:"cpu,omitempty"`
	GPU    int `json:"gpu,omitempty"`
	Memory int `json:"memory,omitempty"`
}

type ThresholdChecker

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

func NewThresholdChecker

func NewThresholdChecker(thresholds config.ThresholdsConfig) *ThresholdChecker

func (*ThresholdChecker) Check

func (c *ThresholdChecker) Check(state *monitor.SystemState) []Reason

func (*ThresholdChecker) GetThresholds

func (c *ThresholdChecker) GetThresholds() config.ThresholdsConfig

GetThresholds returns a copy of the current thresholds.

func (*ThresholdChecker) UpdateThresholds

func (c *ThresholdChecker) UpdateThresholds(thresholds config.ThresholdsConfig)

Jump to

Keyboard shortcuts

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