tsenart/vegeta · error

point with sequence number %d in %v

Error message

point with sequence number %d in %v

What it means

This error is returned by the plot's Add method when the underlying time series (ts.add) rejects a new point. The timestamp is computed as milliseconds since the plot began and added along with the value; if the time series cannot store the point (e.g. out-of-order or duplicate timestamps), the error is wrapped with the point's sequence number for identification.

Source

Thrown at lib/plot/plot.go:103

	}

	if ls.buf[p.seq] = p; p.seq != ls.seq {
		return nil // buffer
	} else if ls.seq == 0 {
		ls.began = r.Timestamp // first point in attack
	}

	for len(ls.buf) > 0 {
		p, ok := ls.buf[ls.seq]
		if !ok {
			break
		}
		delete(ls.buf, ls.seq)

		// timestamp in ms precision
		err = p.ts.add(uint64(p.t.Sub(ls.began))/1e6, p.v)
		if err != nil {
			return fmt.Errorf("point with sequence number %d in %v", p.seq, err)
		}

		ls.seq++
	}

	return nil
}

// Opt is a functional option type for Plot.
type Opt func(*Plot)

// Title returns an Opt that sets the title of a Plot.
func Title(title string) Opt {
	return func(p *Plot) { p.title = title }
}

// Downsample returns an Opt that enables downsampling
// to the given threshold number of data points per labeled series.

View on GitHub (pinned to cf58112690)

Solutions

  1. Ensure results are passed to the plot in the order they were recorded (sort result files by timestamp).
  2. Check the sequence number in the message to locate the offending point and inspect its result file for corrupt timestamps.
  3. Regenerate the input result files with the same vegeta version that produced the plot code.
  4. Update vegeta; newer versions handle timestamp granularity consistently.

Example fix

// before: streaming unsorted result files
files := []string{"late.bin", "early.bin"}
plot(files)
// after: sort inputs chronologically before plotting
sort.Slice(files, func(i, j int) bool { return mtime(files[i]).Before(mtime(files[j])) })
plot(files)
Defensive patterns

Strategy: validation

Validate before calling

// Before plotting, ensure results are chronological and complete
func validateResults(res []vegeta.Result) error {
    for i := 1; i < len(res); i++ {
        if res[i].Timestamp.Before(res[i-1].Timestamp) {
            return fmt.Errorf("out-of-order result at index %d", i)
        }
    }
    return nil
}

Try / catch

if err := plot.Add(res); err != nil {
    if strings.Contains(err.Error(), "point with sequence number") {
        log.Printf("skipping bad point: %v", err)
        continue
    }
    return err
}

Prevention

When it happens

Trigger: Calling Add on a vegeta plot with a Result whose sequence entry yields an invalid or conflicting timestamp for lib/ts, such as a timestamp earlier than the series' window or an internal ts.add failure.

Common situations: Feeding results to the plot reporter out of order, re-running a plot over results with skewed/duplicate timestamps, or corrupted result files from an earlier vegeta version.

Related errors


AI-assisted analysis of tsenart/vegeta@cf58112690 (2026-08-31). Data as JSON: /api/errors/24138b7bbf5cce03. Report an issue: GitHub.