From f01e3b68616a24dba1eb26a14fa2c5c5cc0cf217 Mon Sep 17 00:00:00 2001 From: yanweidong Date: Fri, 6 Dec 2024 16:52:23 +0800 Subject: [PATCH] init --- run.sh | 1 + src/test.js | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 run.sh create mode 100644 src/test.js 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