This commit is contained in:
yanweidong 2024-12-06 16:52:23 +08:00
parent c4e0e8af14
commit f01e3b6861
2 changed files with 13 additions and 0 deletions

1
run.sh Normal file
View File

@ -0,0 +1 @@
K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=./report/test.html k6 run test.js

12
src/test.js Normal file
View File

@ -0,0 +1,12 @@
import http from 'k6/http';
export let options = {
vus: 100, // 指定要同时运行的虚拟用户数量
duration: '10s', // 指定测试运行的总持续时间
};
// default 默认函数
export default function () {
// 标头
let params = { headers: { 'Content-Type': 'application/json' } };
var res=http.get("https://test.k6.io",params)
}