【发布时间】:2021-01-06 14:10:09
【问题描述】:
有没有办法在 K6 中使用跨 VU 共享的静态变量。
说
// init code
let x = 0 // i want this to be static
// options
export let options = {
vus : 10,
iterations : 10
};
// VU code
export default function() {
x++;
console.log(x);
}
当我运行这段代码时,输出应该是递增的(1 到 10),而不是 1 打印 10 次(每个 VU 1)。
【问题讨论】:
标签: k6