Skip to content

Commit

Permalink
Fix a variable name typo
Browse files Browse the repository at this point in the history
  • Loading branch information
na-- committed Jul 6, 2020
1 parent 182297b commit 488a1fb
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions lib/executor/constant_arrival_rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func (car ConstantArrivalRate) Run(parentCtx context.Context, out chan<- stats.S
vusFmt := pb.GetFixedLengthIntFormat(maxVUs)
progIters := fmt.Sprintf(
pb.GetFixedLengthFloatFormat(arrivalRatePerSec, 0)+" iters/s", arrivalRatePerSec)
progresFn := func() (float64, []string) {
progressFn := func() (float64, []string) {
spent := time.Since(startTime)
currActiveVUs := atomic.LoadUint64(&activeVUsCount)
vusInBuffer := uint64(len(activeVUs))
Expand All @@ -310,8 +310,8 @@ func (car ConstantArrivalRate) Run(parentCtx context.Context, out chan<- stats.S

return math.Min(1, float64(spent)/float64(duration)), right
}
car.progress.Modify(pb.WithProgress(progresFn))
go trackProgress(parentCtx, maxDurationCtx, regDurationCtx, &car, progresFn)
car.progress.Modify(pb.WithProgress(progressFn))
go trackProgress(parentCtx, maxDurationCtx, regDurationCtx, &car, progressFn)

runIterationBasic := getIterationRunner(car.executionState, car.logger)
runIteration := func(vu lib.ActiveVU) {
Expand Down
6 changes: 3 additions & 3 deletions lib/executor/constant_vus.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (clv ConstantVUs) Run(parentCtx context.Context, out chan<- stats.SampleCon
logrus.Fields{"vus": numVUs, "duration": duration, "type": clv.config.GetType()},
).Debug("Starting executor run...")

progresFn := func() (float64, []string) {
progressFn := func() (float64, []string) {
spent := time.Since(startTime)
right := []string{fmt.Sprintf("%d VUs", numVUs)}
if spent > duration {
Expand All @@ -166,8 +166,8 @@ func (clv ConstantVUs) Run(parentCtx context.Context, out chan<- stats.SampleCon
pb.GetFixedLengthDuration(spent, duration), duration))
return float64(spent) / float64(duration), right
}
clv.progress.Modify(pb.WithProgress(progresFn))
go trackProgress(parentCtx, maxDurationCtx, regDurationCtx, clv, progresFn)
clv.progress.Modify(pb.WithProgress(progressFn))
go trackProgress(parentCtx, maxDurationCtx, regDurationCtx, clv, progressFn)

// Actually schedule the VUs and iterations...
activeVUs := &sync.WaitGroup{}
Expand Down
6 changes: 3 additions & 3 deletions lib/executor/externally_controlled.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ func (rs *externallyControlledRunState) retrieveStartMaxVUs() error {
return nil
}

func (rs *externallyControlledRunState) progresFn() (float64, []string) {
func (rs *externallyControlledRunState) progressFn() (float64, []string) {
// TODO: simulate spinner for the other case or cycle 0-100?
currentActiveVUs := atomic.LoadInt64(rs.activeVUsCount)
currentMaxVUs := atomic.LoadInt64(rs.maxVUs)
Expand Down Expand Up @@ -536,8 +536,8 @@ func (mex *ExternallyControlled) Run(parentCtx context.Context, out chan<- stats
return err
}

mex.progress.Modify(pb.WithProgress(runState.progresFn)) // Keep track of the progress
go trackProgress(parentCtx, ctx, ctx, mex, runState.progresFn)
mex.progress.Modify(pb.WithProgress(runState.progressFn)) // Keep track of the progress
go trackProgress(parentCtx, ctx, ctx, mex, runState.progressFn)

err = runState.handleConfigChange( // Start by setting MaxVUs to the starting MaxVUs
ExternallyControlledConfigParams{MaxVUs: mex.config.MaxVUs}, currentControlConfig,
Expand Down
6 changes: 3 additions & 3 deletions lib/executor/per_vu_iterations.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (pvi PerVUIterations) Run(parentCtx context.Context, out chan<- stats.Sampl

vusFmt := pb.GetFixedLengthIntFormat(numVUs)
itersFmt := pb.GetFixedLengthIntFormat(int64(totalIters))
progresFn := func() (float64, []string) {
progressFn := func() (float64, []string) {
spent := time.Since(startTime)
progVUs := fmt.Sprintf(vusFmt+" VUs", numVUs)
currentDoneIters := atomic.LoadUint64(doneIters)
Expand All @@ -188,8 +188,8 @@ func (pvi PerVUIterations) Run(parentCtx context.Context, out chan<- stats.Sampl

return float64(currentDoneIters) / float64(totalIters), right
}
pvi.progress.Modify(pb.WithProgress(progresFn))
go trackProgress(parentCtx, maxDurationCtx, regDurationCtx, pvi, progresFn)
pvi.progress.Modify(pb.WithProgress(progressFn))
go trackProgress(parentCtx, maxDurationCtx, regDurationCtx, pvi, progressFn)

// Actually schedule the VUs and iterations...
activeVUs := &sync.WaitGroup{}
Expand Down
6 changes: 3 additions & 3 deletions lib/executor/ramping_arrival_rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func (varr RampingArrivalRate) Run(parentCtx context.Context, out chan<- stats.S
vusFmt := pb.GetFixedLengthIntFormat(maxVUs)
itersFmt := pb.GetFixedLengthFloatFormat(maxArrivalRatePerSec, 0) + " iters/s"

progresFn := func() (float64, []string) {
progressFn := func() (float64, []string) {
currActiveVUs := atomic.LoadUint64(&activeVUsCount)
currentTickerPeriod := atomic.LoadInt64(&tickerPeriod)
vusInBuffer := uint64(len(activeVUs))
Expand All @@ -405,8 +405,8 @@ func (varr RampingArrivalRate) Run(parentCtx context.Context, out chan<- stats.S
return math.Min(1, float64(spent)/float64(duration)), right
}

varr.progress.Modify(pb.WithProgress(progresFn))
go trackProgress(parentCtx, maxDurationCtx, regDurationCtx, varr, progresFn)
varr.progress.Modify(pb.WithProgress(progressFn))
go trackProgress(parentCtx, maxDurationCtx, regDurationCtx, varr, progressFn)

regDurationDone := regDurationCtx.Done()
runIterationBasic := getIterationRunner(varr.executionState, varr.logger)
Expand Down
6 changes: 3 additions & 3 deletions lib/executor/ramping_vus.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ func (vlv RampingVUs) Run(parentCtx context.Context, out chan<- stats.SampleCont
activeVUsCount := new(int64)
vusFmt := pb.GetFixedLengthIntFormat(int64(maxVUs))
regularDurationStr := pb.GetFixedLengthDuration(regularDuration, regularDuration)
progresFn := func() (float64, []string) {
progressFn := func() (float64, []string) {
spent := time.Since(startTime)
currentlyActiveVUs := atomic.LoadInt64(activeVUsCount)
vus := fmt.Sprintf(vusFmt+"/"+vusFmt+" VUs", currentlyActiveVUs, maxVUs)
Expand All @@ -575,8 +575,8 @@ func (vlv RampingVUs) Run(parentCtx context.Context, out chan<- stats.SampleCont
progDur := pb.GetFixedLengthDuration(spent, regularDuration) + "/" + regularDurationStr
return float64(spent) / float64(regularDuration), []string{progVUs, progDur}
}
vlv.progress.Modify(pb.WithProgress(progresFn))
go trackProgress(parentCtx, maxDurationCtx, regDurationCtx, vlv, progresFn)
vlv.progress.Modify(pb.WithProgress(progressFn))
go trackProgress(parentCtx, maxDurationCtx, regDurationCtx, vlv, progressFn)

// Actually schedule the VUs and iterations, likely the most complicated
// executor among all of them...
Expand Down
6 changes: 3 additions & 3 deletions lib/executor/shared_iterations.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (si SharedIterations) Run(parentCtx context.Context, out chan<- stats.Sampl
doneIters := new(uint64)
vusFmt := pb.GetFixedLengthIntFormat(numVUs)
itersFmt := pb.GetFixedLengthIntFormat(int64(totalIters))
progresFn := func() (float64, []string) {
progressFn := func() (float64, []string) {
spent := time.Since(startTime)
progVUs := fmt.Sprintf(vusFmt+" VUs", numVUs)
currentDoneIters := atomic.LoadUint64(doneIters)
Expand All @@ -212,8 +212,8 @@ func (si SharedIterations) Run(parentCtx context.Context, out chan<- stats.Sampl

return float64(currentDoneIters) / float64(totalIters), right
}
si.progress.Modify(pb.WithProgress(progresFn))
go trackProgress(parentCtx, maxDurationCtx, regDurationCtx, &si, progresFn)
si.progress.Modify(pb.WithProgress(progressFn))
go trackProgress(parentCtx, maxDurationCtx, regDurationCtx, &si, progressFn)

var attemptedIters uint64

Expand Down

0 comments on commit 488a1fb

Please sign in to comment.