Documentation
¶
Overview ¶
Package eta computes how much work a job or queue has left, from the task counts, measured run times and attempt progress the store reports.
Index ¶
Constants ¶
const LinearMinElapsed = 30 * time.Second
LinearMinElapsed is how long an attempt must have run before its progress is extrapolated linearly; earlier readings are too noisy to project from.
Variables ¶
This section is empty.
Functions ¶
func ProgressPercent ¶
func ProgressPercent(counts map[store.TaskStatus]int, running float64) *float64
ProgressPercent is the job's completion as a percent: succeeded tasks plus the running tasks' progress (a fraction of one task each), over every task that has not been canceled. It is nil when no such task exists.
Types ¶
type Basis ¶
type Basis string
Basis names what a remaining-time figure was derived from.
const ( // BasisFinished is a terminal job: nothing remains. BasisFinished Basis = "finished" // BasisProgress extrapolates every running task's own progress. BasisProgress Basis = "progress" // BasisMeasured uses the mean run time of each step's succeeded tasks. BasisMeasured Basis = "measured" // BasisEstimate scales the job's submitted estimate by its progress. BasisEstimate Basis = "estimate" )
type Queue ¶
type Queue struct {
WorkRemainingSeconds int64
JobsWithoutEstimate int
RunningTasks int
UnfinishedJobs int
}
Queue totals the remaining work of a queue's unfinished jobs.