Skip to content

Commit 3930d15

Browse files
authored
Merge pull request #110 from adorsys/performance-test
implement performance testing
2 parents dd68697 + 052dd60 commit 3930d15

File tree

18 files changed

+16064
-1
lines changed

18 files changed

+16064
-1
lines changed

.env.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ APP_ENV=development # development | production
77
APP_SERVER__HOST=0.0.0.0
88
APP_SERVER__DOMAIN=statuslist.example.com
99
APP_SERVER__PORT=8000
10+
APP_SERVER__ENABLE_METRICS=false
1011

1112
# Certificate
1213
APP_SERVER__CERT__EMAIL=[email protected]

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ flate2 = "1.1"
7474
x509-parser = "0.18"
7575
public-suffix = "0.1"
7676
tokio-cron-scheduler = "0.15"
77+
metrics-exporter-prometheus = "0.17"
78+
metrics-process = "2.4"
7779

7880
[dependencies.redis]
7981
version = "0.32"

artillery-tests/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
/scripts/ec-private-key.pem
3+
/scripts/ec-public-key.jwk
4+
/scripts/test-tokens.json

artillery-tests/how-to-run.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
## How to run the performance test.
2+
3+
In this tests we have 4 tests which are
4+
1. Load test
5+
2. Stress test
6+
3. Spike test
7+
4. Athentication test
8+
9+
The main aim of each of these tests is to test the performance of the StatusList Server.
10+
11+
### Step 1:
12+
13+
Install artillery.
14+
```bash
15+
npm install -g artillery
16+
```
17+
### Step 3:
18+
19+
The next step is to generate multiple test tokens that we can use during the performance test
20+
21+
```bash
22+
# go to the test directory
23+
cd artillery-tests
24+
25+
# Install dependencies
26+
npm install
27+
28+
# run this
29+
npm run generate-tokens
30+
```
31+
### Step 4:
32+
33+
Create an artillery account at [artillery.io](artillery.io). After creating the account, copy the access key, it should look like this `artillery run test.yml --record --key YOUR_ACCESS_KEY` on the welcome screen.
34+
35+
### Step 5:
36+
37+
Run the test.
38+
```bash
39+
artillery run your_test.yml --name "stress-test" --record --key YOUR_ACCESS_KEY
40+
```
41+
42+
## Memory and CPU usage
43+
44+
Go to `localhost:9090` to access the prometheus dashboard. After that, search for the memory or cpu usage
45+
46+
**Memory usage**:
47+
```text
48+
process_resident_memory_bytes{job="status_list_server"} / 1024 / 1024
49+
```
50+
51+
**CPU usage**:
52+
```text
53+
rate(process_cpu_seconds_total[30s]) * 100
54+
```
55+
56+
Click on graph to see the graph of each.

0 commit comments

Comments
 (0)