manager: show job time left and ETA from the average completed frame time (closes #27) #30
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
blocked
draft
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
s1d3sw1ped/jiggablend!30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ash/job-eta-27"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #27
Why
Job 1 on the trial (1308 frames at about 1m53s each) needed someone to dig through the logs to estimate its finish. The manager now shows it.
What changed
internal/manager/eta.go:computeJobTiming(pure) plusloadJobTiming(reads render tasks).started_at/completed_at, so only the final successful attempt is measured. Queued or paused time sits outside a task's run window.GET /api/jobs,GET /api/jobs/{id}and the batch endpoint returneta_seconds,avg_frame_secondsandelapsed_seconds(whole seconds, omitted when unknown).Testing
goimports -won the touched Go files.loadJobTimingcheck (encode tasks excluded), and template render checks for the list and job page.go test -count=1 ./...on the jumpbox: 201 tests passed. The one failure isTestIntegration_Encode_EXR_H264ininternal/runner/encoding, because the jumpbox has noffmpeg. It fails the same way on develop and isn't touched here.go test -race ./internal/manager ./pkg/types: ok.Risks / rollback
One extra task query per job on the list/get endpoints (the list is capped at 50 jobs). The ETag for a running job changes each second because elapsed time moves. To roll back, revert this commit; there are no schema changes.
GO. This matches #27: the average comes from completed render tasks only (range tasks count every frame, encode tasks are left out), time left divides by the runners busy on the job with a floor of 1, it shows "Estimating..." until a frame finishes, and finished jobs show no time left. The API carries eta_seconds, avg_frame_seconds and elapsed_seconds, and the list and job page both show it. Head
0d58cb7sits on the develop tip, CI is green, and there's no schema change, so the revert is clean.Two small things, neither blocking:
The gofmt whitespace changes in jobs.go, ui.go and types.go are formatter-only.