Skip to content

Instantly share code, notes, and snippets.

@syossan27
Created December 4, 2022 07:43
Show Gist options
  • Save syossan27/3a818a4c729daeb40e48b6b485d3e253 to your computer and use it in GitHub Desktop.
Save syossan27/3a818a4c729daeb40e48b6b485d3e253 to your computer and use it in GitHub Desktop.
// Creator: k6 Browser Recorder 0.6.2
import { sleep, group } from 'k6'
import http from 'k6/http'
export const options = {
discardResponseBodies: true,
scenarios: {
test_scenario: {
// rate, timeUnitを実行するためのExecutor
executor: 'constant-arrival-rate',
duration: '5s',
// timeUnitで指定された時間毎に反復するテスト回数
rate: 20,
// rateを反復させる時間
timeUnit: '1s',
// 初期に割り当てられるVUS数
preAllocatedVUs: 40,
// VUSが足りなかった場合に増える最大VUS数
maxVUs: 100,
},
},
}
export default function main() {
let response
group('page_1 - http://example.com/', function () {
response = http.get('http://example.com/', {
headers: {
'upgrade-insecure-requests': '1',
},
})
})
// Automatically added sleep
sleep(1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment