|
| 1 | +# 🚀 Run Artillery tests |
| 2 | + |
| 3 | +- LOG_LEVEL= `debug` | `info` | `silent` | `debug2` (raw console.log) |
| 4 | +- NETWORK= `naga-dev` | `naga-staging` |
| 5 | + |
| 6 | +### Basic functionality verification |
| 7 | + |
| 8 | +**⭐️ Purpose**: Basic sanity check |
| 9 | + |
| 10 | +- **Users**: 3 people max, 1 new user every minute |
| 11 | +- **Duration**: 30 seconds |
| 12 | +- **Tests**: All main functions once |
| 13 | +- **When to use**: Before releasing code, quick health check, "did I break anything?" |
| 14 | + |
| 15 | +```jsx |
| 16 | +LOG_LEVEL=silent NETWORK=naga-dev bun run artillery:smoke |
| 17 | +``` |
| 18 | + |
| 19 | +### Normal traffic simulation |
| 20 | + |
| 21 | +**⭐️ Purpose**: Simulates typical everyday usage |
| 22 | + |
| 23 | +- **Users**: 30 people max, 10 new users per second during peak |
| 24 | +- **Duration**: 5 minutes total (1min ramp up, 3min steady, 1min ramp down) |
| 25 | +- **Tests**: All functions with realistic ratios (40% signing, 30% encryption, 20% JS execution, 10% viewing) |
| 26 | +- **When to use**: "Will this handle our normal traffic?" |
| 27 | + |
| 28 | +```jsx |
| 29 | +LOG_LEVEL=silent NETWORK=naga-dev bun run artillery:load |
| 30 | +``` |
| 31 | + |
| 32 | +### Find breaking points |
| 33 | + |
| 34 | +**⭐️ Purpose**: Pushes system beyond normal limits to find where it breaks |
| 35 | + |
| 36 | +- **Users**: 200 people max, up to 50 new users per second |
| 37 | +- **Duration**: 11 minutes of gradually increasing pressure |
| 38 | +- **Tests**: Same mix as load test but much more intense |
| 39 | +- **When to use**: "How much traffic can we handle before things go wrong?" |
| 40 | + |
| 41 | +```jsx |
| 42 | +LOG_LEVEL=silent NETWORK=naga-dev bun run artillery:stress |
| 43 | +``` |
| 44 | + |
| 45 | +### Test traffic spikes |
| 46 | + |
| 47 | +**⭐️ Purpose**: Sudden traffic bursts (like when your app goes viral) |
| 48 | + |
| 49 | +- **Users**: 400 people max during spikes, jumps from 2 to 150 users/second instantly |
| 50 | +- **Duration**: 6 minutes with two sudden traffic spikes |
| 51 | +- **Tests**: Focuses on signing and encryption (most critical functions) |
| 52 | +- **When to use**: "What happens if we suddenly get 100x more traffic?" |
| 53 | + |
| 54 | +```jsx |
| 55 | +LOG_LEVEL=silent NETWORK=naga-dev bun run artillery:spike |
| 56 | +``` |
| 57 | + |
| 58 | +### PKP Sign Focused |
| 59 | + |
| 60 | +**⭐️ Purpose**: Hammers the PKP signing functionality specifically |
| 61 | + |
| 62 | +- **Users**: 50 people max, 15 new users per second during peak |
| 63 | +- **Duration**: 7 minutes with sustained high signing load |
| 64 | +- **Tests**: ONLY PKP signing with different authentication methods |
| 65 | +- **When to use**: "Is our signing service robust enough for heavy use?" |
| 66 | + |
| 67 | +```jsx |
| 68 | +LOG_LEVEL=silent NETWORK=naga-dev bun run artillery:pkp-sign |
| 69 | +``` |
| 70 | + |
| 71 | +### Encrypt-Decrypt Focused |
| 72 | + |
| 73 | +**⭐️ Purpose**: Hammers encryption/decryption functionality specifically |
| 74 | + |
| 75 | +- **Users**: 30 people max, 8 new users per second during peak |
| 76 | +- **Duration**: 6 minutes of sustained encryption/decryption |
| 77 | +- **Tests**: ONLY encryption and decryption functions |
| 78 | +- **When to use**: "Can our encryption handle lots of data processing?" |
| 79 | + |
| 80 | +```jsx |
| 81 | +LOG_LEVEL=silent NETWORK=naga-dev bun run artillery:encrypt-decrypt |
| 82 | +``` |
| 83 | + |
| 84 | +## (Optional) Generating a report |
| 85 | + |
| 86 | +Generating a report required an API key, you can add that to the root `.env` file. You can find your key at [https://app.artillery.io/](https://app.artillery.io/oivpr8dw4i00f) |
| 87 | + |
| 88 | +```jsx |
| 89 | +ARTILLERY_KEY = xxx; |
| 90 | +``` |
0 commit comments