Documentation ¶
Index ¶
- type AvailableResource
- type AverageResourceUsage
- type CheckResourceReport
- type Container
- type ContainerResourceUsage
- type CpuUsage
- type DistributeError
- type DistributorName
- type EventType
- type Job
- type JobStatus
- type Log
- type LogSeverity
- type MemorySize
- type MemoryUsage
- type NodeEntry
- type OSResourceUsage
- type Task
- func (t *Task) AddLog(severity LogSeverity, message string, parameters map[string]string)
- func (t *Task) CPWaitTimeout()
- func (t *Task) DistributionFailure(nodeID string, err error)
- func (t *Task) DistributionSuccess(nodeID string)
- func (t *Task) DoneExperimentTask()
- func (t *Task) ExperimentTask()
- func (t *Task) SkipExperimentTask()
- func (t *Task) SuccessTask(nodeID string, result []byte)
- func (t *Task) WorkOnTaskFailure(nodeID string, message string)
- type TaskEventBus
- type TaskResourceUsage
- type TaskResponse
- type TaskStatus
- type TaskWithContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvailableResource ¶ added in v0.0.5
type AvailableResource struct { CpuCores int64 AvailableCpuPercentage float32 AvailableMemory MemorySize }
type AverageResourceUsage ¶ added in v0.0.15
type AverageResourceUsage struct { IsInitialized bool AverageCpuUsage float64 AverageMemoryUsage MemorySize }
type CheckResourceReport ¶
type CheckResourceReport struct { CpuUsageExceed float64 MemoryUsageExceed MemorySize ContainerResourceUsages []ContainerResourceUsage }
type ContainerResourceUsage ¶
type ContainerResourceUsage struct { ContainerIdShort string CpuUsage string MemoryUsage dockerstats.MemoryStats }
type DistributeError ¶ added in v0.0.12
type DistributorName ¶ added in v0.0.12
type DistributorName string
const ( RoundRobinDistributorName DistributorName = "round_robin" ResourceAwareDistributorName DistributorName = "resource_aware" )
type Job ¶
type Job struct { ID *primitive.ObjectID `bson:"_id,omitempty" json:"id"` Name string `bson:"name" json:"name"` Status JobStatus `bson:"status" json:"status"` IsExperiment bool `bson:"is_experiment" json:"isExperiment"` ImageURL string `bson:"image_url" json:"imageURL"` DistributorLogic DistributorName `bson:"distributor_logic" json:"distributorLogic"` CreatedAt time.Time `bson:"created_at" json:"createdAt"` UpdatedAt time.Time `bson:"updated_at" json:"updatedAt"` Logs []Log `bson:"logs" json:"logs"` }
func (*Job) AddLog ¶ added in v0.0.15
func (j *Job) AddLog(severity LogSeverity, message string, parameters map[string]string)
func (*Job) DistributingJob ¶ added in v0.0.15
func (j *Job) DistributingJob()
func (*Job) ExperimentingJob ¶ added in v0.0.15
func (j *Job) ExperimentingJob()
func (*Job) FailedJobStatus ¶ added in v0.0.15
func (*Job) SuccessJobStatus ¶ added in v0.0.15
func (j *Job) SuccessJobStatus()
type LogSeverity ¶
type LogSeverity string
const ( InfoLogSeverity LogSeverity = "info" WarnLogSeverity LogSeverity = "warn" ErrorLogSeverity LogSeverity = "error" )
type MemorySize ¶
type OSResourceUsage ¶
type OSResourceUsage struct { MemoryUsage MemoryUsage CpuUsage CpuUsage }
type Task ¶
type Task struct { ID *primitive.ObjectID `bson:"_id,omitempty" json:"id"` Status TaskStatus `bson:"task_status" json:"status" ` ImageUrl string `bson:"image_url" json:"imageURL"` JobID *primitive.ObjectID `bson:"job_id" json:"jobID"` TaskAttributes []byte `bson:"task_attributes" json:"taskAttributes"` LatestDistributedNodeID string `bson:"latest_distributed_node_id,omitempty" json:"latestDistributedNodeID,omitempty"` Logs []Log `bson:"logs,omitempty" json:"logs"` CreatedAt time.Time `bson:"created_at" json:"createdAt"` UpdatedAt time.Time `bson:"updated_at" json:"updatedAt"` Result *[]byte `bson:"result,omitempty" json:"-"` RetryCount int `bson:"retry_count" json:"retryCount"` ResourceUsage TaskResourceUsage `bson:"resource_usage,omitempty" json:"resourceUsage"` }
func (*Task) AddLog ¶
func (t *Task) AddLog(severity LogSeverity, message string, parameters map[string]string)
func (*Task) CPWaitTimeout ¶ added in v0.0.14
func (t *Task) CPWaitTimeout()
func (*Task) DistributionFailure ¶
func (*Task) DistributionSuccess ¶
func (*Task) DoneExperimentTask ¶ added in v0.0.8
func (t *Task) DoneExperimentTask()
func (*Task) ExperimentTask ¶ added in v0.0.5
func (t *Task) ExperimentTask()
func (*Task) SkipExperimentTask ¶ added in v0.0.5
func (t *Task) SkipExperimentTask()
func (*Task) SuccessTask ¶
func (*Task) WorkOnTaskFailure ¶
type TaskEventBus ¶ added in v0.0.14
type TaskResourceUsage ¶ added in v0.0.5
type TaskResourceUsage struct { Memory float64 `bson:"memory" json:"memory"` CPU float32 `bson:"cpu" json:"cpu"` }
func (*TaskResourceUsage) AverageWithOther ¶ added in v0.0.5
func (t *TaskResourceUsage) AverageWithOther(other TaskResourceUsage)
type TaskResponse ¶ added in v0.0.15
type TaskResponse struct {
ID string
}
type TaskStatus ¶
type TaskStatus string
const ( CreatedTaskStatus TaskStatus = "created" ReadyToDistribute TaskStatus = "ready-to-distribute" DistributedTaskStatus TaskStatus = "distributed" WorkOnTaskFailure TaskStatus = "work-on-task-failure" SuccessTaskStatus TaskStatus = "success" )
type TaskWithContext ¶
type TaskWithContext struct { Task Task Ctx context.Context CancelFunc func() ContainerId string AverageResourceUsage AverageResourceUsage }
Click to show internal directories.
Click to hide internal directories.