Conversation
...te/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/executor/ATModeExecutor.java
Fixed
Show fixed
Hide fixed
...te/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/executor/ATModeExecutor.java
Fixed
Show fixed
Hide fixed
.../seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/executor/SagaModeExecutor.java
Fixed
Show fixed
Hide fixed
...te/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/executor/ATModeExecutor.java
Fixed
Show fixed
Hide fixed
...te/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/executor/ATModeExecutor.java
Fixed
Show fixed
Hide fixed
.../seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/executor/SagaModeExecutor.java
Dismissed
Show dismissed
Hide dismissed
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.x #7865 +/- ##
============================================
- Coverage 71.60% 71.58% -0.03%
+ Complexity 884 872 -12
============================================
Files 1300 1300
Lines 49701 49701
Branches 5895 5895
============================================
- Hits 35589 35576 -13
- Misses 11192 11210 +18
+ Partials 2920 2915 -5 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request introduces a new seata-benchmark-cli module - a command-line tool for stress testing Seata transaction modes (AT, TCC, and SAGA). The tool supports both "empty mode" (protocol overhead testing) and "real mode" (actual transaction execution) to measure Seata's performance characteristics.
Key Changes:
- CLI-based benchmark tool with picocli framework for argument parsing
- Support for AT, TCC, and SAGA transaction modes with configurable TPS rate limiting
- Dual execution modes: empty transactions for pure protocol overhead testing, and real transactions with database/state machine operations
- Comprehensive metrics collection including latency percentiles (P50/P95/P99), success rates, and TPS measurements with CSV export capability
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| test-suite/seata-benchmark-cli/pom.xml | Maven configuration with dependencies for CLI framework, testcontainers, SAGA engine, and benchmark utilities |
| test-suite/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/BenchmarkApplication.java | Main entry point with CLI argument handling and benchmark orchestration |
| test-suite/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/config/* | Configuration classes for loading/merging benchmark parameters from CLI, YAML, and environment |
| test-suite/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/executor/* | Transaction executors for AT, TCC, and SAGA modes with workload generation |
| test-suite/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/model/* | Data models for metrics collection and transaction records |
| test-suite/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/saga/* | SAGA mode service implementations with state machine support |
| test-suite/seata-benchmark-cli/src/main/resources/* | Configuration files for Seata client and SAGA state machine definitions |
| test-suite/seata-benchmark-cli/README.md | Comprehensive documentation with usage examples and implementation details |
| pom.xml | Added new benchmark module to test-suite |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ite/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/model/BenchmarkMetrics.java
Show resolved
Hide resolved
...te/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/executor/ATModeExecutor.java
Show resolved
Hide resolved
...ata-benchmark-cli/src/main/java/org/apache/seata/benchmark/saga/BenchmarkServiceInvoker.java
Show resolved
Hide resolved
.../seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/executor/SagaModeExecutor.java
Outdated
Show resolved
Hide resolved
...ite/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/model/BenchmarkMetrics.java
Outdated
Show resolved
Hide resolved
.../seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/executor/SagaModeExecutor.java
Outdated
Show resolved
Hide resolved
...ata-benchmark-cli/src/main/java/org/apache/seata/benchmark/config/BenchmarkConfigLoader.java
Show resolved
Hide resolved
...te/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/executor/ATModeExecutor.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 17 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ⅰ. Describe what this PR did
Closes: #7646
Add a new
seata-benchmark-climodule undertest-suitefor stress testing Seata transaction modes.Features:
--branches 0): Measures pure Seata protocol overhead without database operations--branches N): Executes actual distributed transactions with database operationsModule Structure:
Ⅱ. Does this pull request fix one issue?
No, this is a new feature.
Ⅲ. Why don't you add test cases (unit test/integration test)?
This is a benchmark/stress testing tool. The primary validation is manual testing against a running Seata Server. Integration tests would require a full Seata Server setup which is better suited for the existing integration test infrastructure.
Ⅳ. Describe how to verify it
Build the module:
cd test-suite/seata-benchmark-cli ../../mvnw clean packageStart Seata Server (ensure it's running on 127.0.0.1:8091)
Run benchmark (empty mode - no database required):
Run benchmark (real mode - requires Docker):
Verify the output shows progress every 10 seconds and final report with metrics.
Ⅴ. Special notes for reviews
Latency Sampling: To prevent OOM on large-scale tests, latencies are sampled (max 500K samples) - inspired by Kafka ProducerPerformance.
Empty vs Real Mode: Empty mode (
--branches 0) is useful for measuring pure Seata Server capacity without database overhead.SAGA Implementation: Real SAGA mode uses Seata's state machine engine with predefined state machine definitions in
src/main/resources/seata/saga/statelang/.Dependencies: The module uses:
picoclifor CLI argument parsingsnakeyamlfor YAML configurationtestcontainersfor MySQL in real mode