How pvkcseaccet/stresster works
Main Components
• Main Entry Point: Use the StressTester class (located at src/main/java/com/stresster/StressTester.java) as the central controller for initiating tests.
• Core Infrastructure: The “core” package (e.g., ConcurrentRequestHandler.java and Util.java) manages concurrency and utility functions.
• Domain Model: The “domain” package (e.g., TestType.java) encapsulates the different test types.
• Exception Handling: The “exception” package holds custom exceptions (e.g., StressterException, StressterExceptionStore).
• Parsing Modules: The “parser” package (DataFetcher.java, DataParser.java) is responsible for reading and interpreting the JSON test definitions.
• Reporting: The “reports” package (HtmlReportGenerator.java, ReportingDataAccumulator.java) generates formatted performance reports, with supplementary resources under the “resources/reports” directory.
• Resource Models: The “resources” package defines the data structures (e.g., Request, Response, TestProps, and TestResults) used throughout the application.
• Templates: HTML templates (src/main/resources/templates/report.html) are used for report visualization.
Relationships and Interactions
• Initialization: StressTester acts as the main driver, reading configuration from a test properties file (provided externally) and using the DataParser/DataFetcher to read the actual test data.
• Concurrency Management: The ConcurrentRequestHandler coordinates the concurrent HTTP request execution using Java’s concurrency utilities (like CyclicBarrier and FutureTask) as mentioned in the README.
• Request/Response Flow: Data moves from the parsed request definitions (located in TestProps and request-related resources) through the ConcurrentRequestHandler, which then passes HTTP responses back to be accumulated.
• Reporting: Reporting components accumulate performance metrics and generate an HTML report via the HtmlReportGenerator using the pre-defined template.
• Exception Handling: Any issues during test execution are managed by the custom exception components.
Architectural Patterns and Key Technologies
• Modularity: The clear separation of concerns across packages (domain, core, parser, reports, exception, and resources) supports maintainability and scalability.
• Concurrency Pattern: Synchronized and asynchronous execution patterns are used (via utilities such as CyclicBarrier and FutureTask) to manage high parallelism.
• Reporting & Data Flow: Data aggregation and transformation for producing performance results, which is a crucial part of the architecture.
• Tech Stack: Java (JDK 11+), Gradle for build automation (indicated by build.gradle.kts, gradlew, and settings.gradle.kts), JSON library for parsing, and Lombok for code generation.
Final Checklist
• Use clear, descriptive labels (e.g., “StressTester (Main Driver)”, “Concurrent Request Handler”, “Data Parser”, “Html Report Generator”).
• Differentiate between the layers (Frontend: Reporting outputs, Core: Concurrency and Processing, Backend: Request/Response handling).
• Depicting external dependencies briefly (e.g., JSON and Lombok) since they affect how certain modules operate.
• Maintain a high level of detail so that every key component and its connection to others is visibly mapped.