Documentation
¶
Index ¶
Constants ¶
View Source
const (
AppName = "agent_scheduler"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SelectBestAgentRequest ¶
type SelectBestAgentRequest struct {
// Agent ID 列表
AgentIds []string `json:"agent_ids" form:"agent_ids" query:"agent_ids"`
// 调度算法
ScheduleAlgorithm ALGORITHM `json:"schedule_algorithm" form:"schedule_algorithm" query:"schedule_algorithm"`
// 统计时间范围,单位分钟
DurationMinutes int64 `json:"duration_minutes" form:"duration_minutes" query:"duration_minutes"`
}
func NewSelectBestAgentRequest ¶
func NewSelectBestAgentRequest() *SelectBestAgentRequest
func (*SelectBestAgentRequest) AddAgentId ¶
func (r *SelectBestAgentRequest) AddAgentId(ids ...string) *SelectBestAgentRequest
type Service ¶
type Service interface {
// SelectBestAgent 根据 Metric 列表,选取一个最优的 Agent ID 进行任务调度
// 参考 Kubernetes 调度策略,采用两阶段调度:
// 1. 过滤阶段:筛选出资源充足的 Agent
// 2. 打分阶段:对通过过滤的 Agent 进行打分,选择最优 Agent
SelectBestAgent(ctx context.Context, metrics *SelectBestAgentRequest) (string, error)
}
Service Agent 调度器接口 根据 Agent 指标选择最优 Agent 进行任务调度
func GetService ¶
func GetService() Service
Click to show internal directories.
Click to hide internal directories.