Created
December 18, 2023 09:25
-
-
Save un4ckn0wl3z/ca91b98f037f405a45800540f5f4f142 to your computer and use it in GitHub Desktop.
k6.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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