Skip to content

Instantly share code, notes, and snippets.

@un4ckn0wl3z
Created December 18, 2023 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save un4ckn0wl3z/ca91b98f037f405a45800540f5f4f142 to your computer and use it in GitHub Desktop.
Save un4ckn0wl3z/ca91b98f037f405a45800540f5f4f142 to your computer and use it in GitHub Desktop.
k6.js
// import http from "k6/http";
// export const options = {
// iterations: 1000,
// };
// export default function () {
// const response = http.get("http://localhost:3000/health");
// }
import http from 'k6/http';
import { sleep } from 'k6';
export const options = {
discardResponseBodies: true,
scenarios: {
contacts: {
executor: 'per-vu-iterations',
vus: 1000,
iterations: 20,
maxDuration: '30s',
},
},
};
export default function () {
http.get('http://localhost:3000/health');
// Injecting sleep
// Sleep time is 500ms. Total iteration time is sleep + time to finish request.
sleep(0.5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment