优秀开源项目推进:像写单元测试一样做性能测试,k6(留坑)
发布于 8 年前 作者 i5ting 4748 次浏览 来自 分享

Like unit testing, for performance

https://k6.io/

https://github.com/loadimpact/k6

留坑

$ docker pull loadimpact/k6
$ cat script.js
import { check } from "k6";
import http from "k6/http";

export default function() {
    let res = http.get("https://httpbin.org/");
    check(res, {
        "is status 200": (r) => r.status === 200
    });
};

$ docker run -i loadimpact/k6 run --vus 10 --duration 30s - <script.js
3 回复

@taove 还用猜。。。

回到顶部