API load testing for developers

Goal oriented with checks (like asserts) and thresholds, automation friendly, notifications in Slack.
Oh, and you write your test cases in ES6 JS, for our open source load testing tool k6.

01. Four steps - It all starts with the code

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

export let options = {
    stages: [
        { duration: "10m", target: 10 }
    ],
    thresholds: {
        http_req_duration: ["p(50)<100", "p(95)<500"]
    }
};

export default function() {
    let data = JSON.stringify({ email: "<account email>", password: "<account password>" });
    let res = http.post("https://api.loadimpact.com/v3/account/login", data,
                        { headers: { "Content-Type": "application/json" } });
    check(res, {
        "is status 200": (r) => r.status === 200
    });
    res = http.get("https://api.loadimpact.com/v3/account/me", data,
                   { headers: { "Authorization": `Token ${res.json().token.key}` } });
    check(res, {
        "is status 200": (r) => r.status === 200,
        "is email correct": (r) => r.body.json().user.email === "<account email>"
    });
    sleep(30);
};

$ docker run -i loadimpact/k6 run - <script.js

02. Automate your load testing

We believe load testing should be goal oriented, and that's why we've built k6 as a command-line tool with functionality like Checks (like asserts) and Thresholds. If a threshold fails, k6 will exit with a non-zero exit code. In short, we've built k6 to be automation friendly, so that it's easily added as a step in CircleCI  or another CI tool of choice.

CI load test from CircleCI

03. Get notified in Slack

To stay completely out of your way, when your tests finish, we can notify you in Slack. Be the first to know when your goals pass or fail! Notifications can also be sent to HipChat or via Webhook.

Slack notification

04. Analyze results with Insights

Insights is the perfect companion to k6, when you want a more visual experience analysing test results. Graphs, graphs and some more graphs! It includes our Smart Performance Analysis feature, where our performance engineering expertise is distilled into an algorithm to help you highlight performance problems automatically.

To stream your k6 results to Insights, you need to first join our early access program Insiders, and get your API token to use in the following command:

$ K6CLOUD_TOKEN=<Your LoadImpact API token> docker run -i loadimpact/k6 run -o cloud - <script.js
Result analysis with Insights
Postman API performance testing

Postman user? Go direct from API spec to performance hero, your collection can be converted to a script in seconds.

Use LoadImpact's integration with Postman to load test your Postman API collections