diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..b10f6c8 --- /dev/null +++ b/run.sh @@ -0,0 +1 @@ +K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=./report/test.html k6 run test.js \ No newline at end of file diff --git a/src/test.js b/src/test.js new file mode 100644 index 0000000..d7971ab --- /dev/null +++ b/src/test.js @@ -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) +} \ No newline at end of file