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

Check for errors during performance test by checking HTTP status. #19

Merged
merged 1 commit into from
Jan 22, 2015

Conversation

ewencp
Copy link
Contributor

@ewencp ewencp commented Jan 15, 2015

Previously ProducerPerformance read, but ignored the response entity and
ConsumerPerformance didn't read the response entity when the HTTP method was
DELETE, so both had conditions where they could miss errors. Although this
doesn't check for specific, expected statuses, checking for any >= 400 should
catch any important errors.

Previously ProducerPerformance read, but ignored the response entity and
ConsumerPerformance didn't read the response entity when the HTTP method was
DELETE, so both had conditions where they could miss errors. Although this
doesn't check for specific, expected statuses, checking for any >= 400 should
catch any important errors.
@ewencp
Copy link
Contributor Author

ewencp commented Jan 22, 2015

@granders Can you review this when you have a chance -- there's nothing really kafka-rest specific and you're now the other expert on the perf code.

@granders
Copy link
Contributor

Seems like a good idea to check for http error codes.

Both these request blocks have some overall similarity to/convergence with RestUtils.httpRequest in schema registry. It might make sense to refactor and share httpRequest in the common package.

Doubly so since the behavior of HttpUrlRequest API is (to me at least) quite unintuitive.

@ewencp
Copy link
Contributor Author

ewencp commented Jan 22, 2015

Agreed, I don't like the duplicated code. But I'm not yet sure what that utility would look like without duplicating a lot of the interface of HttpUrlConnection. At least a few things vary across the different implementations -- setting headers, how error codes are checked, and how responses are decoded. We might want to file an issue on confluentinc/common to provide a good wrapper or set of wrappers.

@granders
Copy link
Contributor

+1
I opened issue 12 (confluentinc/common#12) in case we want to revisit the idea.

ewencp added a commit that referenced this pull request Jan 22, 2015
Check for errors during performance test by checking HTTP status.
@ewencp ewencp merged commit e36e7a2 into master Jan 22, 2015
@ewencp ewencp deleted the performance-test-error-handling branch January 22, 2015 19:23
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 this pull request may close these issues.

2 participants