You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The suite uses a default `STRELLER_LOAD_MULTIPLIER=10` to simulate 10x peak load, writes JSON and Markdown reports to `target/`, and has a CI-safe mode available via `./scripts/load_test.sh --ci`.
213
+
214
+
See [docs/LOAD_TESTING.md](docs/LOAD_TESTING.md) for the configurable load variables and report format.
215
+
197
216
#### Property-Based Tests
198
217
199
218
We use `proptest` to verify contract invariants with random inputs:
This document outlines the load testing suite and performance benchmarks implemented for the StrellerMinds smart contracts.
3
+
This repository includes a contract load-testing suite for scalability and performance benchmarking. The suite runs in Soroban's host-side test environment, which keeps CI stable while still stressing contract execution paths, storage writes, and repeated reads at a configurable 10x peak multiplier.
4
4
5
-
## 🚀 Overview
5
+
## What the suite measures
6
6
7
-
The load testing suite is designed to evaluate how the system behaves under stress, specifically focusing on transaction throughput, resource consumption (CPU/Memory), and latency when multiple users interact with the contracts.
7
+
- Latency and duration per scenario
8
+
- Throughput in operations per second
9
+
- Failed operations
10
+
- Emitted contract events
11
+
- Estimated persistent state writes
12
+
- Process RSS memory delta on Linux runners when available
13
+
- Bottleneck notes generated from p95 latency, throughput, and write intensity heuristics
8
14
9
-
## 📁 Structure
15
+
## Scenarios
10
16
11
17
-**E2E Load Tests**: Located in `e2e-tests/tests/load_testing.rs`. These tests run against a live Soroban network (e.g., localnet).
12
18
-**Internal Benchmarks**: Located in `contracts/token/src/benchmarks.rs`. These are unit tests that measure execution efficiency within the `soroban-sdk` test environment.
13
19
-**CI/CD Integration**: Automated daily runs via GitHub Actions (`.github/workflows/load-testing.yml`) to track baseline metrics and alert on performance regressions.
14
20
15
-
## 🧪 Load Scenarios
21
+
1.`progress-write-hot-path`
22
+
Runs repeated `record_progress` calls against a tight course set to stress hot writes.
23
+
2.`progress-write-multi-course`
24
+
Spreads `record_progress` calls across more courses to grow student course lists and storage churn.
25
+
3.`progress-read-heavy`
26
+
Seeds progress data, then benchmarks `get_progress` and `get_student_courses` under sustained reads.
16
27
17
28
### 1. High Volume Analytics Recording
18
29
-**Scenario**: Simulates multiple students recording learning sessions simultaneously.
19
30
-**Component**: `analytics` contract.
20
31
-**Goal**: Measure throughput (ops/sec) and ensure non-blocking transaction flow.
21
32
-**Running**: `LOAD_TEST_REQUESTS=10000 cargo test --test load_testing test_load_analytics_recording_stress -- --ignored`
22
33
23
-
### 2. Leaderboard Generation Performance
24
-
-**Scenario**: Measures the time taken to generate leaderboards with a large set of student data.
25
-
-**Component**: `analytics` contract.
26
-
-**Goal**: Ensure leaderboard sorting and calculation remain efficient as the user base grows.
27
-
-**Running**: `cargo test --test load_testing test_load_leaderboard_generation_performance -- --ignored`
34
+
The runner simulates:
28
35
29
-
### 3. Diagnostics Monitoring Overhead
30
-
-**Scenario**: Compares transaction execution time with and without active diagnostics monitoring.
We use the `diagnostics` contract to monitor performance during load tests. Key metrics tracked include:
53
-
-`average_execution_time`: Average time per transaction.
54
-
-`gas_used`: Resource consumption per operation.
55
-
-`error_rate`: Percentage of failed transactions under load.
123
+
If the generated bottleneck notes mention tail latency or write intensity, the usual next step is to inspect storage-heavy contract code paths, symbol creation patterns, and list growth in persistent storage.
56
124
57
-
## 📝 Reviewing Effectiveness
125
+
## CI integration
58
126
59
-
Load tests should be reviewed:
60
-
1.**After major refactors**: To ensure no performance regressions.
61
-
2.**Before mainnet deployment**: To validate system capacity.
62
-
3.**When adding new features**: To check impact on existing throughput.
127
+
The main CI workflow includes a dedicated `Load Testing` job that:
63
128
64
-
---
129
+
1. Uses bounded environment defaults
130
+
2. Runs `./scripts/load_test.sh --ci`
131
+
3. Uploads the JSON and Markdown reports as workflow artifacts
65
132
66
-
*Verified on: 2026-03-27*
133
+
This keeps the suite safe for pull requests while still catching regressions in latency, throughput, and storage-heavy paths.
0 commit comments