grafana/k6 · error

the iteration rate isn't specified

Error message

the iteration rate isn't specified

What it means

ConstantArrivalRateConfig.Validate found the 'rate' option unset (null.NullInt64 not valid) for a constant-arrival-rate executor. The rate — iterations per timeUnit — is the defining option of this executor, so its absence is fatal configuration error #1 in the Validate chain.

Source

Thrown at lib/executor/constant_arrival_rate.go:94

	timeUnit := carc.TimeUnit.TimeDuration()
	var arrRatePerSec float64
	if maxVUs != 0 { // TODO: do something better?
		ratio := big.NewRat(maxVUs, carc.MaxVUs.Int64)
		arrRate := big.NewRat(carc.Rate.Int64, int64(timeUnit))
		arrRate.Mul(arrRate, ratio)
		arrRatePerSec, _ = getArrivalRatePerSec(arrRate).Float64()
	}

	return fmt.Sprintf("%.2f iterations/s for %s%s", arrRatePerSec, carc.Duration.Duration,
		carc.getBaseInfo(maxVUsRange))
}

// Validate makes sure all options are configured and valid
func (carc *ConstantArrivalRateConfig) Validate() []error {
	errors := carc.BaseConfig.Validate()
	if !carc.Rate.Valid {
		errors = append(errors, fmt.Errorf("the iteration rate isn't specified"))
	} else if carc.Rate.Int64 <= 0 {
		errors = append(errors, fmt.Errorf("the iteration rate must be more than 0"))
	}

	if carc.TimeUnit.TimeDuration() <= 0 {
		errors = append(errors, fmt.Errorf("the timeUnit must be more than 0"))
	}

	if !carc.Duration.Valid {
		errors = append(errors, fmt.Errorf("the duration is unspecified"))
	} else if carc.Duration.TimeDuration() < minDuration {
		errors = append(errors, fmt.Errorf(
			"the duration must be at least %s, but is %s", minDuration, carc.Duration,
		))
	}

	if !carc.PreAllocatedVUs.Valid {
		errors = append(errors, fmt.Errorf("the number of preAllocatedVUs isn't specified"))

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Set rate in the executor options, e.g. { executor: 'constant-arrival-rate', rate: 10, timeUnit: '1s', duration: '10m', preAllocatedVUs: 10, maxVUs: 50 }
  2. Remember exported scripts keep rate as iterations per timeUnit, not per second
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/executor/constant_arrival_rate.go:94 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/358dee93a8b4567e. Report an issue: GitHub.