Documentation ¶
Overview ¶
Package demand defines Tasks
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task struct { // Name Name string // Scheduler Demand int Requested int Running int // Container config info FamilyName string Image string Command string PublishAllPorts bool NetworkMode string Env []string // Scaling config IsScalable bool Priority int MaxDelta int MinContainers int MaxContainers int // The target we're aiming for Target target.Target // Measurements Metric metric.Metric // Scaling calculation of the ideal number of containers we'd have if there were no other tasks IdealContainers int }
Task describes an app (or you might want to call it a service, or a container). It has all the info for starting / stopping an instance of a task, scaling config & params, the target and metric we use for this task, and state information about the number of tasks.
func (*Task) CanScaleDown ¶
CanScaleDown returns the number we could scale down by
func (*Task) IsRemainder ¶
IsRemainder returns true if this task uses up unused resources
func (*Task) ScaleDownCount ¶
ScaleDownCount tells us how many we should scale down by Call this after IdealContainers has been updated
func (*Task) ScaleUpCount ¶
ScaleUpCount tells us how many containers to scale up by Call this after IdealContainers has been updated
type Tasks ¶
Tasks is a list of tasks, with a global lock. Global config about tasks can go here too.
func (*Tasks) CheckCapacity ¶
CheckCapacity returns number of containers we have space for
func (*Tasks) Exited ¶
Exited returns whether tasks have all drained down to 0 so we can quit microscaling
func (*Tasks) PrioritySort ¶
PrioritySort reorders tasks in priority order (or reverse priority order)