0.0.11
Feature Release: Duration-Based Load Testing
This release introduces a major new core feature: duration-based load testing. In addition to the existing request-count mode, users can now specify an exact runtime duration for a test, enabling more flexible and realistic performance testing scenarios.
✨ What's New
- New Duration-Based Mode (--duration):
You can now specify the total test runtime using the --duration argument (e.g., 30s, 1m, 2h). In this mode, the tool will continuously send requests with the configured concurrency for the entire specified duration. This is crucial for evaluating system performance and stability under sustained load. - Refactored Request-Count Mode (--requests):
The original request-based testing mode has been significantly improved. We've implemented a thread-safe global request counter using Arc to ensure precise control over the total number of requests in high-concurrency scenarios. This replaces the previous implementation with a more robust and performant solution. - Core Logic Refactoring & Code Optimization:
To support the two distinct testing modes, the core task submission logic has been split from a single function into submit_task_duration and submit_task_requests. This refactoring makes the codebase cleaner, more maintainable, and easier to extend in the future.
🚀 How to Use
You can now choose one of two modes for your load test:
1. Run by Duration (e.g., run for 30 seconds with 10 concurrent users):
kt --duration 30s -c 10 https://api.example.com/
2. Run by Request Count (e.g., run a total of 1000 requests with 10 concurrent users):
kt --requests 1000 -c 10 https://api.example.com/
Summary
This update significantly enhances the tool's flexibility, enabling it to handle a wider variety of performance testing scenarios. Whether you need to run a quick burst test or a long-running endurance test, roachy is now better equipped for the job.