diff --git a/k6-long-test.js b/k6-long-test.js new file mode 100644 index 0000000000..373ee5451c --- /dev/null +++ b/k6-long-test.js @@ -0,0 +1,15 @@ +import http from 'k6/http'; +import { sleep } from 'k6'; + +export const options = { + stages: [ + { duration: '3m', target: 5000 }, // ramp-up to 5000 users + { duration: '10m', target: 5000 }, // hold at 5000 users + { duration: '3m', target: 0 }, // ramp-down to 0 users + ], +}; + +export default function () { + http.get('http://localhost:4567/recent'); + sleep(1); +} diff --git a/k6-short-test.js b/k6-short-test.js new file mode 100644 index 0000000000..02db93f5ed --- /dev/null +++ b/k6-short-test.js @@ -0,0 +1,15 @@ +import http from 'k6/http'; +import { sleep } from 'k6'; + +export const options = { + stages: [ + { duration: '2m', target: 300 }, // ramp-up to 300 users + { duration: '5m', target: 300 }, // hold at 300 users + { duration: '2m', target: 0 }, // ramp-down to 0 + ], +}; + +export default function () { + http.get('http://localhost:4567/recent'); + sleep(1); +} diff --git a/k6-spike-test.js b/k6-spike-test.js new file mode 100644 index 0000000000..b675607d72 --- /dev/null +++ b/k6-spike-test.js @@ -0,0 +1,16 @@ +import http from 'k6/http'; +import { sleep } from 'k6'; + +export const options = { + stages: [ + { duration: '2m', target: 15000 }, // spike to 15,000 users + { duration: '1m', target: 0 }, // quick ramp-down to 0 + { duration: '2m', target: 15000 }, // another spike to 15,000 users + { duration: '1m', target: 0 }, // ramp-down again + ], +}; + +export default function () { + http.get('http://localhost:4567/recent'); + sleep(1); +}