-
Notifications
You must be signed in to change notification settings - Fork 1
Add support for using Java or Restify HTTP clients #20
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
base: develop
Are you sure you want to change the base?
Conversation
@@ -26,25 +34,62 @@ | |||
* @author Daniel DeGroff | |||
*/ | |||
public class JavaHTTPLoadTestWorker extends BaseWorker { | |||
private final HttpClient javaHTTPClient = HttpClient.newBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to do this initialization in a constructor? I'm not a fan of having anything that feels like logic outside of a method, but that's kind of just personal preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can move it. We have this same pattern in prime-mvc
, so I just copied it, but I can move it to the constructor.
} | ||
|
||
if (response.exception != null) { | ||
System.out.println(response.exception.getClass().getSimpleName() + " [" + response.exception.getMessage() + "]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason we're using stdout directly instead of a logging framework?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No particular reason. This is essentially a CLI tool, and most of the output is all using stdout
for reporting, etc.
We could consider moving all of the stdout
to a logger config.
In practice, this is really just for debugging - looking for SocketExceptions
based upon some server configuration I was testing. I could probably just delete these lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the chunked
configuration work? Doesn't it need to set the header Transfer-Encoding: chunked
?
Also seems like we'd want large bodies in this case.
Summary
Doing some work with loading testing in
java-http
. This adds support to allow the test definition to swap between the Java REST client and ours (Restify) easily.This is useful to see the difference in performance.
Related