feat: enhance load testing with increased user and friendship counts#2321
feat: enhance load testing with increased user and friendship counts#2321
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @robfrank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request enhances the ArcadeDB project's performance testing capabilities by introducing new test classes, scaling existing load tests, optimizing database interactions, and updating container configurations to improve memory and threading capabilities. These changes aim to provide a more robust and scalable testing environment.
Highlights
- New Test Classes: Added
SingleLocalhostServerSimpleLoadTestITandSingleServerSimpleLoadTestITto test load scenarios with single servers, using fixed-size thread pools and TestContainers respectively. These include metrics logging and assertions for user, photo, and friendship counts. - Load Test Enhancements: Updated
SingleServerLoadTestITto increase load testing scale by modifyingnumOfUsers,numOfPhotos, andnumOfFriendshipparameters. Simplified friendship creation logic. - Database Interaction Optimizations: Enhanced
DatabaseWrapperwith a 30-second timeout for remote connections, improved error handling with transaction rollback and stack trace logging inaddUserAndPhotos, and simplified friendship creation usingUserIdSupplierfor efficient user ID fetching. ModifiedaddFriendshipto useResultSetfor edge creation commands. - Container Configuration Updates: Increased
httpsIoThreadsfrom 10 to 30 for better concurrency handling and addedARCADEDB_OPTS_MEMORYto allocate 16GB of memory for containerized servers.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request enhances performance testing capabilities by increasing the scale of load tests and adding new test scenarios. I've provided feedback focusing on a critical fix to remove a System.exit(1) call from a test utility and to correct hardcoded passwords.
| e.printStackTrace(); | ||
| System.exit(1); |
There was a problem hiding this comment.
Calling System.exit(1) within a test utility is a critical issue. It will terminate the entire JVM, preventing the test suite from completing and generating proper reports. Failures in tests should be handled by throwing exceptions, which the test framework can catch and report.
Additionally, e.printStackTrace() should be avoided in favor of logging frameworks. The logger call should include the exception object to log the full stack trace.
| e.printStackTrace(); | |
| System.exit(1); | |
| logger.error("Error creating user {}: {}", userId, e.getMessage(), e); | |
| throw new RuntimeException("Failed to create user " + userId, e); |
| 2480, | ||
| DATABASE, | ||
| "root", | ||
| "pippopluto"); |
There was a problem hiding this comment.
The password pippopluto is hardcoded and appears to be incorrect. The setup instructions in SingleLocalhostServerSimpleLoadTestIT specify using playwithdata as the root password. This mismatch will likely cause authentication failures.
Please use the correct password and consider defining it as a constant to improve maintainability and avoid such inconsistencies.
| RemoteServer server = new RemoteServer("localhost", | ||
| 2480, | ||
| "root", | ||
| "pippopluto"); |
There was a problem hiding this comment.
The password pippopluto is hardcoded here and appears to be incorrect. The setup instructions in SingleLocalhostServerSimpleLoadTestIT specify using playwithdata as the root password. This mismatch will likely cause authentication failures when creating the database.
Please use the correct password and consider defining it as a constant to improve maintainability and avoid such inconsistencies.
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Co-authored-by: lvca <lvca@users.noreply.github.com> (cherry picked from commit 68e9359)
This pull request introduces significant updates to performance tests and supporting utilities for the ArcadeDB project. Key changes include the addition of new test classes, enhancements to existing load tests, optimizations in database interaction, and updates to container configurations for improved memory and threading capabilities.
New Test Classes
SingleLocalhostServerSimpleLoadTestITto test load scenarios with a single server using a fixed-size thread pool for parallel operations. Includes metrics logging and assertions for user, photo, and friendship counts.SingleServerSimpleLoadTestIT, a simplified load test class using TestContainers for containerized server testing. Similar logic to the localhost test but tailored for container-based environments.Enhancements to Load Tests
SingleServerLoadTestITto increase the scale of load testing by modifying parameters:numOfUsers,numOfPhotos, andnumOfFriendship. Simplified friendship creation logic by removing iterations and using a single parameter. [1] [2]Optimizations in Database Interaction
DatabaseWrapper:addUserAndPhotosby enabling transaction rollback and logging errors with stack traces.UserIdSupplier, which fetches user IDs in batches for efficient processing. [1] [2]addFriendshipto useResultSetfor edge creation commands.Updates to Container Configuration
httpsIoThreadsfrom 10 to 30 for better concurrency handling.ARCADEDB_OPTS_MEMORYenvironment variable to allocate 16GB of memory for containerized servers.Checklist
mvn clean packagecommand