{"record":{"id":"24138b7bbf5cce03","repo":"tsenart/vegeta","slug":"point-with-sequence-number-d-in-v","errorCode":null,"errorMessage":"point with sequence number %d in %v","messagePattern":"point with sequence number (.+?) in (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/plot/plot.go","lineNumber":103,"sourceCode":"\t}\n\n\tif ls.buf[p.seq] = p; p.seq != ls.seq {\n\t\treturn nil // buffer\n\t} else if ls.seq == 0 {\n\t\tls.began = r.Timestamp // first point in attack\n\t}\n\n\tfor len(ls.buf) > 0 {\n\t\tp, ok := ls.buf[ls.seq]\n\t\tif !ok {\n\t\t\tbreak\n\t\t}\n\t\tdelete(ls.buf, ls.seq)\n\n\t\t// timestamp in ms precision\n\t\terr = p.ts.add(uint64(p.t.Sub(ls.began))/1e6, p.v)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"point with sequence number %d in %v\", p.seq, err)\n\t\t}\n\n\t\tls.seq++\n\t}\n\n\treturn nil\n}\n\n// Opt is a functional option type for Plot.\ntype Opt func(*Plot)\n\n// Title returns an Opt that sets the title of a Plot.\nfunc Title(title string) Opt {\n\treturn func(p *Plot) { p.title = title }\n}\n\n// Downsample returns an Opt that enables downsampling\n// to the given threshold number of data points per labeled series.","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/tsenart/vegeta/blob/cf5811269046c672a604b1eb352204d30f16ae4a/lib/plot/plot.go#L85-L121","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure results are passed to the plot in the order they were recorded (sort result files by timestamp).","Check the sequence number in the message to locate the offending point and inspect its result file for corrupt timestamps.","Regenerate the input result files with the same vegeta version that produced the plot code.","Update vegeta; newer versions handle timestamp granularity consistently."],"exampleFix":"// before: streaming unsorted result files\nfiles := []string{\"late.bin\", \"early.bin\"}\nplot(files)\n// after: sort inputs chronologically before plotting\nsort.Slice(files, func(i, j int) bool { return mtime(files[i]).Before(mtime(files[j])) })\nplot(files)","handlingStrategy":"validation","validationCode":"// Before plotting, ensure results are chronological and complete\nfunc validateResults(res []vegeta.Result) error {\n    for i := 1; i < len(res); i++ {\n        if res[i].Timestamp.Before(res[i-1].Timestamp) {\n            return fmt.Errorf(\"out-of-order result at index %d\", i)\n        }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := plot.Add(res); err != nil {\n    if strings.Contains(err.Error(), \"point with sequence number\") {\n        log.Printf(\"skipping bad point: %v\", err)\n        continue\n    }\n    return err\n}","preventionTips":["Sort result files by timestamp before plotting.","Feed results to the plot in recording order.","Regenerate corrupt/old result files rather than mixing versions."],"tags":["go","time-series","plotting"],"backgroundTag":"invalid-timestamp","analyzedSha":"cf5811269046c672a604b1eb352204d30f16ae4a","analyzedAt":"2026-08-31T11:04:20.464Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}