Skip to content

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

robotdan
Copy link
Member

@robotdan robotdan commented May 30, 2025

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

@@ -26,25 +34,62 @@
* @author Daniel DeGroff
*/
public class JavaHTTPLoadTestWorker extends BaseWorker {
private final HttpClient javaHTTPClient = HttpClient.newBuilder()

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.

Copy link
Member Author

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() + "]");

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?

Copy link
Member Author

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.

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