eta

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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.

func Queues

func Queues(jobs []store.JobTiming, now time.Time) map[string]Queue

Queues totals remaining work per queue over the given jobs.

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.

type Remaining

type Remaining struct {
	Seconds *int64
	Basis   Basis
}

Remaining is a job's remaining work in seconds. Seconds is nil, and Basis empty, when nothing is known.

func Job

func Job(t store.JobTiming, now time.Time) Remaining

Job computes a job's remaining work, trying in order: finished, running tasks' linear progress, measured step means, the submitted estimate.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL