Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot not starting at t=0 when there are error responses #391

Closed
mightyguava opened this issue Apr 18, 2019 · 2 comments · Fixed by #398
Closed

Plot not starting at t=0 when there are error responses #391

mightyguava opened this issue Apr 18, 2019 · 2 comments · Fixed by #398

Comments

@mightyguava
Copy link

mightyguava commented Apr 18, 2019

Version and Runtime

v12.3.0@7bf09f4fab4d852141935796455c17459d212098

Expected Behaviour

vegeta plot creates a graph at t=0

Actual Behaviour

vegeta plot created a graph starting at t=892

vegeta-plot (2)
exp-009-read.html.zip

Steps to Reproduce

I used vegeta as a library in my load test, against DynamoDB, to test what happens when requests go over the provisioned capacity. My requests started getting throttled at around the 15 minute mark, which is exactly where the plot starts. I'm guessing a bug in plotting specifically.

Unfortunately I can't share the repo, but the setup I think is pretty standard:

func main() {
	rate := vegeta.Rate{Freq: flags.RPS, Per: time.Second}
	duration := flags.Duration
	sess := session.Must(session.NewSession(&aws.Config{
		Region: &flags.AWSRegion,
	}))
	svc := dynamodb.New(sess)
	attacker := vegeta.NewAttacker()

	var res <-chan *vegeta.Result
	switch flags.Op {
	case "write":
		targeter := loadtest.DynamoWriteTargeter(svc, flags.TableName)
		res = attacker.Attack(targeter, rate, duration, "PutItem")
	case "read":
		targeter, err := loadtest.DynamoReadTargeter(svc, flags.TableName, flags.ReadSetSize)
		if err != nil {
			return errors.Wrapf(err, "failed to create read targeter")
		}
		res = attacker.Attack(targeter, rate, duration, "GetItem")
	default:
		logrus.Fatalf("invalid op %s", flags.Op)
	}
	sig := make(chan os.Signal, 1)
	signal.Notify(sig, os.Interrupt)

	var out io.WriteCloser
	out, err := file(flags.Out, true)
	if err != nil {
		return err
	}
	defer out.Close()
	if strings.HasSuffix(flags.Out, ".gz") {
		out = gzip.NewWriter(out)
		defer out.Close()
	}
	enc := vegeta.NewEncoder(out)

encodeLoop:
	for {
		select {
		case <-sig:
			attacker.Stop()
			return nil
		case r, ok := <-res:
			if !ok {
				break encodeLoop
			}
			if err := enc.Encode(r); err != nil {
				return err
			}
		}
	}
}
@mightyguava mightyguava changed the title Plot not starting at t=0 when there are errors Plot not starting at t=0 when there are error responses Apr 18, 2019
@tsenart
Copy link
Owner

tsenart commented Apr 21, 2019

Would you be able to store your results in a file with the response body and other sensitive data elided? Sharing that with me would really help debugging.

@mightyguava
Copy link
Author

Sure, here's the results gzipped in gob format. https://s3-us-west-2.amazonaws.com/yunchi-dynamodb-test/exp-009-stripped.bin.gz

tsenart added a commit that referenced this issue Apr 28, 2019
This commit makes the `Plot.data` method return `dataPoints` sorted by
their X axis value (i.e. elapsed seconds)

Previously, each series would be added discontinuously to each other,
essentially not being merge-sorted correctly.

Fixes #391
tsenart added a commit that referenced this issue Apr 29, 2019
* plot: Sort data points by time elapsed

This commit makes the `Plot.data` method return `dataPoints` sorted by
their X axis value (i.e. elapsed seconds)

Previously, each series would be added discontinuously to each other,
essentially not being merge-sorted correctly.

Fixes #391

* plot: Red and green color pallettes

This commit makes the output color pallettes more intuitive. Reds for
any labels that contain the word ERROR. Greens otherwise.

Any plot with more series than the available colors will be hard to
read because the colors will cycle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants