impl

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentSchedulerServiceImpl

type AgentSchedulerServiceImpl struct {
	ioc.ObjectImpl

	// 过滤阶段阈值配置
	Filter FilterThreshold `json:"filter" yaml:"filter" toml:"filter"`

	// 打分阶段权重配置
	Score ScoreWeight `json:"score" yaml:"score" toml:"score"`

	// 使用 Redis INCR 原子性递增计数器,实现多实例轮询
	RRRedisKey string `json:"rr_redis_key" yaml:"rr_redis_key" toml:"rr_redis_key"`
	// contains filtered or unexported fields
}

func (*AgentSchedulerServiceImpl) Init

func (i *AgentSchedulerServiceImpl) Init() error

func (*AgentSchedulerServiceImpl) Name

func (*AgentSchedulerServiceImpl) SelectBestAgent

SelectBestAgent 根据 Metric 列表,选取一个最优的 Agent ID 进行任务调度

type FilterThreshold

type FilterThreshold struct {
	// CPU 使用率阈值(百分比)
	CPUUsagePercent float64 `json:"cpu_usage_percent" yaml:"cpu_usage_percent" toml:"cpu_usage_percent"`
	// 内存使用率阈值(百分比)
	MemoryUsagePercent float64 `json:"memory_usage_percent" yaml:"memory_usage_percent" toml:"memory_usage_percent"`
	// 磁盘使用率阈值(百分比)
	DiskUsagePercent float64 `json:"disk_usage_percent" yaml:"disk_usage_percent" toml:"disk_usage_percent"`
	// Inode 使用率阈值(百分比)
	InodeUsagePercent float64 `json:"inode_usage_percent" yaml:"inode_usage_percent" toml:"inode_usage_percent"`
	// 文件句柄使用率阈值(百分比)
	FileHandleUsagePercent float64 `json:"file_handle_usage_percent" yaml:"file_handle_usage_percent" toml:"file_handle_usage_percent"`
}

FilterThreshold 过滤阈值配置

type ResourceWeight

type ResourceWeight struct {
	// CPU 权重(0-1)
	CPUWeight float64 `json:"cpu_weight" yaml:"cpu_weight" toml:"cpu_weight"`
	// 内存权重(0-1)
	MemoryWeight float64 `json:"memory_weight" yaml:"memory_weight" toml:"memory_weight"`
	// 磁盘权重(0-1)
	DiskWeight float64 `json:"disk_weight" yaml:"disk_weight" toml:"disk_weight"`
	// Inode 权重(0-1)
	InodeWeight float64 `json:"inode_weight" yaml:"inode_weight" toml:"inode_weight"`
	// 文件句柄权重(0-1)
	FileHandleWeight float64 `json:"file_handle_weight" yaml:"file_handle_weight" toml:"file_handle_weight"`
}

ResourceWeight 资源得分内部权重配置

type ScoreWeight

type ScoreWeight struct {
	// 资源得分权重(0-1)
	ResourceWeight float64 `json:"resource_weight" yaml:"resource_weight" toml:"resource_weight"`
	// 负载得分权重(0-1)
	LoadWeight float64 `json:"load_weight" yaml:"load_weight" toml:"load_weight"`
	// 任务数得分权重(0-1)
	TaskWeight float64 `json:"task_weight" yaml:"task_weight" toml:"task_weight"`
	// 资源平衡得分权重(0-1)
	BalanceWeight float64 `json:"balance_weight" yaml:"balance_weight" toml:"balance_weight"`

	// 资源得分内部权重
	Resource ResourceWeight `json:"resource" yaml:"resource" toml:"resource"`
}

ScoreWeight 打分权重配置

Jump to

Keyboard shortcuts

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