Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

优秀开源项目推进:像写单元测试一样做性能测试,k6(留坑)

$
0
0

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

Viewing all articles
Browse latest Browse all 14821

Trending Articles