Skip to content

Instantly share code, notes, and snippets.

@luketn
Created August 31, 2020 01:36
Show Gist options
  • Save luketn/3f191cffb7f815074d7e99cf848a02e0 to your computer and use it in GitHub Desktop.
Save luketn/3f191cffb7f815074d7e99cf848a02e0 to your computer and use it in GitHub Desktop.
import http from 'k6/http';
import { check } from "k6";
export let options = {
stages: [
// Ramp-up from 1 to 5 VUs in 5s
{ duration: "5s", target: 5 },
// Stay at rest on 5 VUs for 10s
{ duration: "10s", target: 5 },
// Ramp-down from 5 to 0 VUs for 5s
{ duration: "5s", target: 0 }
]
};
export default function () {
const response = http.get("https://swapi.dev/api/people/30/", {headers: {Accepts: "application/json"}});
check(response, { "status is 200": (r) => r.status === 200 });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment