A comprehensive benchmark tool for stress testing the /v1/write/transaction endpoint with detailed performance metrics and webhook event tracking.
- ✅ Concurrent request execution with configurable concurrency
- 📊 Detailed metrics tracking (HTTP response time, submission time, confirmation time)
- 🎣 Built-in webhook server to capture transaction lifecycle events
- 📈 Statistical analysis (p50, p90, p95, p99, min, max, mean)
- 📄 CSV export of individual transaction metrics
- 📊 JSON export of aggregate results
- 🎯 Real-time progress and status updates
-
Copy the
.env.exampleto.envin the/scriptsdirectory:cp .env.example .env
-
Configure your environment variables in
.env:BASE_URL=http://localhost:3005 TYPE=eoa FROM=0x1234567890123456789012345678901234567890 CHAIN_ID=1337 SECRET_KEY=your-secret-key VAULT_ACCESS_TOKEN=your-vault-access-token CONCURRENT_REQUESTS=10 TOTAL_REQUESTS=100
Run the benchmark from the /scripts directory:
cd scripts
bun ./benchmarks/eoa.tsThe benchmark creates a timestamped directory run-<timestamp>/ containing:
transactions-<timestamp>.csv- Individual transaction metricsresult-<timestamp>.json- Aggregate statistics
Each row contains:
transaction_id- Unique transaction identifierhttp_response_time_ms- HTTP request/response timesent_to_submitted_ms- Time from send to submitted webhooksubmitted_to_confirmed_ms- Time from submitted to confirmed webhooktotal_time_ms- Total time from send to confirmedstatus- Final status (confirmed/failed/pending)error- Error message if failed
Aggregate results include:
- Total/successful/failed request counts
- Error rate percentage
- Duration and throughput (req/s)
- Statistical breakdown for all timing metrics (min, max, mean, p50, p90, p95, p99)
| Variable | Default | Description |
|---|---|---|
BASE_URL |
http://localhost:3005 |
API endpoint base URL |
TYPE |
eoa |
Execution type |
FROM |
required | Sender address |
CHAIN_ID |
1337 |
Blockchain network ID |
SECRET_KEY |
required | API secret key |
VAULT_ACCESS_TOKEN |
required | Vault access token |
CONCURRENT_REQUESTS |
10 |
Number of concurrent requests |
TOTAL_REQUESTS |
100 |
Total number of requests to send |
- Webhook Server: Starts a local server on port 3070 to receive transaction lifecycle webhooks
- Request Sending: Sends HTTP requests to
/v1/write/transactionwith controlled concurrency - Event Tracking: Tracks webhook events for each transaction:
sendstage withSuccessevent = transaction submittedconfirmstage withSuccessevent = transaction confirmedFailureorNackevents = transaction failed
- Metrics Calculation: Computes timing metrics and statistics
- Output Generation: Writes CSV and JSON files with results
Based on executors/src/eoa/events.rs, the webhook payload contains:
{
"transaction_id": "...",
"executor_name": "eoa",
"stage_name": "send" | "confirm",
"event_type": "Success" | "Nack" | "Failure",
"payload": { ... }
}🚀 Starting benchmark...
📊 Configuration:
Base URL: http://localhost:3005
Type: eoa
From: 0x1234...
Chain ID: 1337
Total Requests: 100
Concurrent Requests: 10
📤 Sent 10/100 requests...
...
✅ All HTTP requests completed
⏳ Waiting for webhooks to complete...
🎉 All transactions completed!
📊 BENCHMARK RESULTS
============================================================
📈 Overview:
Total Requests: 100
Successful: 98
Failed: 2
Error Rate: 2.00%
Duration: 45.23s
Throughput: 2.21 req/s
⏱️ HTTP Response Times (ms):
Min: 45.23
Mean: 123.45
P50: 110.00
P90: 180.00
P95: 210.00
P99: 250.00
Max: 320.00
...
- Start with a small
TOTAL_REQUESTSvalue to test your setup - Adjust
CONCURRENT_REQUESTSbased on your server capacity - Monitor your server logs alongside the benchmark
- The script waits up to 2 minutes for pending webhooks before timing out
- Use the CSV output for detailed per-transaction analysis
- Use the JSON output for automated performance regression testing