Created
October 10, 2022 04:56
-
-
Save perfmind/7bc1f2cb20b1eef7fc09ea567db58414 to your computer and use it in GitHub Desktop.
k6 example script
This file contains hidden or 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'; | |
| import { sleep } from 'k6'; | |
| export const options = { | |
| scenarios: { | |
| test: { | |
| executor: 'ramping-vus', | |
| startVUs: 0, | |
| stages: [ | |
| { duration: `${15 * (__ENV.DURATION) / 100}m`, target: `${__ENV.VUS}` }, | |
| { duration: `${(__ENV.DURATION) - (30 * (__ENV.DURATION) / 100)}m`, target: `${__ENV.VUS}` }, | |
| { duration: `${15 * (__ENV.DURATION) / 100}m`, target: 0 } | |
| ], | |
| gracefulRampDown: '0s' | |
| } | |
| } | |
| } | |
| export default function () { | |
| const params = { | |
| headers: { | |
| 'device-id': '', | |
| 'x-api-key': 'c78e6b6f6dbb0ebd271167b078e18ae5', | |
| 'x-api-version': 'v1' | |
| } | |
| } | |
| http.get( | |
| 'https://sandbox.qiu.id/accounts/auth/refresh/XVlBzgbaiCMRAjWwhTHctcuAxhxKQFDa', | |
| params | |
| ) | |
| sleep(1) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment