Skip to content

Instantly share code, notes, and snippets.

@davidmukiibi
Created November 15, 2019 11:44
Show Gist options
  • Save davidmukiibi/cad43503e9c8e9689db18ca14341b89b to your computer and use it in GitHub Desktop.
Save davidmukiibi/cad43503e9c8e9689db18ca14341b89b to your computer and use it in GitHub Desktop.
k6 performance test script
import { check, sleep } from "k6";
import http from "k6/http";
export let options = {
stages: [
{ duration: "60s", target: 10 },
{ duration: "60s", target: 0 }
],
thresholds: {
http_req_duration: ["p(95)<500"]
}
};
export default function() {
let res = http.get("https://test.loadimpact.com/");
check(res, {
"is status 200": (r) => r.status === 200
});
sleep(10);
;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment