Documentation ¶
Index ¶
- Variables
- func Compare(task1 *Task, task2 *Task) bool
- func GetTaskDistributionInWindow(windowSize int, tasks []Task) (float64, error)
- func SortTasks(ts []Task, sb SortBy)
- func WattsToConsider(task Task, classMapWatts bool, offer *mesos.Offer) (float64, error)
- type Metric
- type SortBy
- type Task
- type TaskCluster
- type TaskResources
- type TasksToClassify
Constants ¶
This section is empty.
Variables ¶
var ( SortByCPU = func(task *Task) float64 { return task.CPU } SortByRAM = func(task *Task) float64 { return task.RAM } SortByWatts = func(task *Task) float64 { return task.Watts } )
Possible Sorting Criteria. Each holds a closure that fetches the required resource from the
given task reference.
Functions ¶
func GetTaskDistributionInWindow ¶
Determine the distribution of light power consuming and heavy power consuming tasks in a given window.
func SortTasks ¶
Generic Task Sorter. Be able to sort an array of tasks based on any of the tasks' resources.
func WattsToConsider ¶
Determine the watts value to consider for each task.
This value could either be task.Watts or task.ClassToWatts[<power class>] If task.ClassToWatts is not present, then return task.Watts (this would be for workloads which don't have classMapWatts).
Types ¶
type SortBy ¶
the sortBy function that takes a task reference and returns the resource to consider when sorting.
type Task ¶
type Task struct { Name string `json:"name"` CPU float64 `json:"cpu"` RAM float64 `json:"ram"` Watts float64 `json:"watts"` Image string `json:"image"` CMD string `json:"cmd"` Instances *int `json:"inst"` Host string `json:"host"` TaskID string `json:"taskID"` ClassToWatts map[string]float64 `json:"class_to_watts"` }
func TasksFromJSON ¶
func (*Task) UpdateHost ¶
Update the host on which the task needs to be scheduled.
type TaskCluster ¶
type TaskCluster struct { ClusterIndex int Tasks []Task SizeScore int // How many other clusters is this cluster bigger than }
Information about a cluster of tasks.
func ClassifyTasks ¶
func ClassifyTasks(tasks []Task, numberOfClusters int) []TaskCluster
type TaskResources ¶
Map taskIDs to resource requirements.
func GetResourceRequirement ¶
func GetResourceRequirement(taskID string) (TaskResources, error)
Retrieve the resource requirement of a task specified by the TaskID
type TasksToClassify ¶
type TasksToClassify []Task
Classification of Tasks using KMeans clustering using the watts consumption observations.