-
Notifications
You must be signed in to change notification settings - Fork 8.9k
feature: benchmark cli #7865
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
WangzJi
wants to merge
12
commits into
apache:2.x
Choose a base branch
from
WangzJi:feat/benchmark-cli
base: 2.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feature: benchmark cli #7865
+3,426
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...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
Dismissed
Show dismissed
Hide dismissed
...te/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/executor/ATModeExecutor.java
Dismissed
Show dismissed
Hide dismissed
.../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.20% 71.17% -0.04%
+ Complexity 797 785 -12
============================================
Files 1300 1300
Lines 49620 49620
Branches 5874 5874
============================================
- Hits 35331 35315 -16
- Misses 11371 11387 +16
Partials 2918 2918 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ⅰ. 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