Skip to content

Instantly share code, notes, and snippets.

@perfmind
Created October 10, 2022 04:56
Show Gist options
  • Select an option

  • Save perfmind/7bc1f2cb20b1eef7fc09ea567db58414 to your computer and use it in GitHub Desktop.

Select an option

Save perfmind/7bc1f2cb20b1eef7fc09ea567db58414 to your computer and use it in GitHub Desktop.
k6 example script
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