diff --git a/ChangeLog b/ChangeLog index cbc439ba4..9dd0b1529 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Version 17.12.5 +--------------- + * Add a stat for number of BUILD files currently parsing (#3290) + Version 17.12.4 --------------- * Reverted back to arcat v1.0.2 while we work out behavioural issues diff --git a/VERSION b/VERSION index e14324392..a93455c71 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.12.4 +17.12.5 diff --git a/src/core/state.go b/src/core/state.go index f98cce26c..da61ef2a2 100644 --- a/src/core/state.go +++ b/src/core/state.go @@ -279,6 +279,7 @@ type stateProgress struct { numActive int64 numPending int64 numDone int64 + numParses atomic.Int64 mutex sync.Mutex closeOnce sync.Once resultOnce sync.Once @@ -370,6 +371,11 @@ func (state *BuildState) AddPendingTest(target *BuildTarget) { } } +// Parses returns the number of current parse tasks +func (state *BuildState) Parses() *atomic.Int64 { + return &state.progress.numParses +} + func (state *BuildState) addPendingTest(target *BuildTarget, numRuns int) { atomic.AddInt64(&state.progress.numPending, int64(numRuns)) go func() { diff --git a/src/output/interactive_display.go b/src/output/interactive_display.go index c642238b3..503fcdd23 100644 --- a/src/output/interactive_display.go +++ b/src/output/interactive_display.go @@ -46,7 +46,7 @@ type plainDisplay struct { func (d *plainDisplay) Update(targets []buildingTarget) { localbusy, remotebusy := countActive(targets) - log.Notice("Build running for %s, %d / %d tasks done, %s busy", time.Since(d.state.StartTime).Round(time.Second), d.state.NumDone(), d.state.NumActive(), pluralise(localbusy+remotebusy, "worker", "workers")) + log.Notice("Build running for %s, %d / %d tasks done, %s busy, parsing %d BUILD files", time.Since(d.state.StartTime).Round(time.Second), d.state.NumDone(), d.state.NumActive(), pluralise(localbusy+remotebusy, "worker", "workers"), d.state.Parses().Load()) } func countActive(targets []buildingTarget) (local int, remote int) { diff --git a/src/plz/plz.go b/src/plz/plz.go index fac5e036f..0eba00951 100644 --- a/src/plz/plz.go +++ b/src/plz/plz.go @@ -51,7 +51,9 @@ func Run(targets, preTargets []core.BuildLabel, state *core.BuildState, config * go func() { for task := range parses { go func(task core.ParseTask) { + state.Parses().Add(1) parse.Parse(state, task.Label, task.Dependent, task.Mode) + state.Parses().Add(-1) state.TaskDone() }(task) }