Show the progress rate over the last 5 seconds, and what a phase is doing after 10 seconds with no item done (closes #125)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
The rate was the phase's average, so a burst after a long wait read as over 1,000 files a second. It now covers the items completed over the last 5 seconds, or since the line before off a terminal; the ETA still comes from the average. Once no item has completed for 10 seconds, the rate gives way to "stalled" and what the phase is doing, as "stalled reading", kept whole with the phase, progress, elapsed time and ETA, so only the bar gives way before them. report's read phase says "read/write", as it writes the report while it reads. The tests set the display's clock by hand. Deviation: the stall words hold no time; with one, no words naming the work fit beside the rest at 80 columns. Judgement call: trees' group phase says "grouping". Model: opus-5-5
This commit is contained in:
@@ -446,7 +446,7 @@ func (s *scanState) loadIndex(ctx context.Context, roots []string) error {
|
||||
// first gives the display its total.
|
||||
prog := newProgress(progressParams{
|
||||
label: scanPhase("load"), unit: scanUnit, total: -1,
|
||||
waitingFor: countingRecords,
|
||||
waitingFor: countingRecords, doing: reading,
|
||||
})
|
||||
defer prog.finish()
|
||||
|
||||
@@ -497,7 +497,7 @@ func (s *scanState) walkPhase(
|
||||
|
||||
prog := newProgress(progressParams{
|
||||
label: scanPhase("walk"), unit: scanUnit, total: estimate,
|
||||
estimate: true,
|
||||
estimate: true, doing: "listing",
|
||||
})
|
||||
|
||||
var (
|
||||
@@ -689,6 +689,7 @@ func (s *scanState) readRuns(ctx context.Context, workers int,
|
||||
|
||||
prog := newProgress(progressParams{
|
||||
label: scanPhase(label), unit: scanUnit, total: int64(len(runs)),
|
||||
doing: reading,
|
||||
})
|
||||
defer prog.finish()
|
||||
|
||||
@@ -778,6 +779,7 @@ func (s *scanState) updatePhase(ctx context.Context) error {
|
||||
total := len(s.batch) + len(s.sentinels) + len(deletes)
|
||||
prog := newProgress(progressParams{
|
||||
label: scanPhase("update"), unit: scanUnit, total: int64(total),
|
||||
doing: "writing",
|
||||
})
|
||||
|
||||
defer prog.finish()
|
||||
@@ -866,7 +868,7 @@ func (s *scanState) contentCandidates(
|
||||
// the search returns, and so do their rate and ETA.
|
||||
prog := newProgress(progressParams{
|
||||
label: scanPhase("content"), unit: scanUnit, total: -1,
|
||||
waitingFor: "searching the database",
|
||||
waitingFor: "searching the database", doing: "searching",
|
||||
})
|
||||
defer prog.finish()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user