Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions examples/http.proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Listens on https port `7143` and will response back whatever is hosted in `nginx

- docker compose
- [nghttp2](https://nghttp2.org/)
- [k6](https://k6.io/)

### Install nghttp2 client

Expand Down Expand Up @@ -57,6 +58,18 @@ id responseEnd requestStart process code size request path

you get `/style.css` response as push promise that nginx is configured with.

### Install k6

```bash
brew install k6
```

## Performance Test

```bash
k6 run k6-test.js
```

## Teardown

To remove any resources created by the Docker Compose stack, use:
Expand Down
21 changes: 21 additions & 0 deletions examples/http.proxy/k6-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import http from 'k6/http';
import { check, sleep } from 'k6';

export let options = {
insecureSkipTLSVerify: true,
stages: [
{ duration: '10s', target: 50 }, // Ramp-up: 10 VUs over 10 seconds
{ duration: '30s', target: 50 }, // Steady state: 10 VUs for 30 seconds
{ duration: '10s', target: 0 } // Ramp-down: 0 VUs over 10 seconds
],
};

export default function () {
let res = http.get('https://localhost:7143/payload.html');

check(res, {
'is status 200': (r) => r.status === 200
});

sleep(1); // Wait for 1 second between iterations
}
1 change: 1 addition & 0 deletions examples/http.proxy/www/payload.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World!
Loading