Skip to content

Commit

Permalink
Add performance testing scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
drizzentic committed Aug 12, 2024
1 parent 0882027 commit f8c6c1e
Show file tree
Hide file tree
Showing 6 changed files with 1,610 additions and 0 deletions.
55 changes: 55 additions & 0 deletions test/performance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Performance testing the IPS implementation

## Setup details

The performance runner utilizes K6 along with custom extensions for generating fake data.

To include additional extensions, refer to the following resources to build your desired binary:

- [Build a K6 Binary using Docker](https://k6.io/docs/extensions/guides/build-a-k6-binary-using-docker/)
- [K6 Extensions Documentation](https://k6.io/docs/extensions/)
- Faker Extension:
- [GitHub Repository](https://github.com/szkiba/xk6-faker)
- [Documentation](https://ivan.szkiba.hu/xk6-faker/index.html)

Example command to build a binary with the Faker extension:

```
docker run --rm -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" grafana/xk6 build --with github.com/szkiba/xk6-faker --with github.com/grafana/xk6-output-prometheus-remote@latest
```

## Run a specific performance test

Different types of performance testing can be implemented to verify various aspects of the system. Refer to the [Testing Guides](https://grafana.com/docs/k6/latest/testing-guides/test-types/) for an example guide.

#### Volume test

Ensure that all systems are connected and responding as intended.

```
./k6 run scripts/smoke.js
```

#### Load test

Run the system under load by gradually increasing the number of Virtual Users (VUs) and maintaining this load for a specified duration before ramping down.

```
./k6 run scripts/load.js
```

#### Stress test

Apply a high load to the system by rapidly increasing the number of VUs and pushing the system to its limits.

```
./k6 run scripts/stress.js
```

#### Soak test

Run the system under a sustained load for an extended period to identify any potential performance degradation or resource leaks.

```
./k6 run scripts/soak.js
```
Binary file added test/performance/k6
Binary file not shown.
Loading

0 comments on commit f8c6c1e

Please sign in to comment.