Skip to content

Instantly share code, notes, and snippets.

@andreafspeziale
Created March 1, 2023 15:25
Show Gist options
  • Save andreafspeziale/330e968bbe327b64723400a5112b149f to your computer and use it in GitHub Desktop.
Save andreafspeziale/330e968bbe327b64723400a5112b149f to your computer and use it in GitHub Desktop.
k6 script example
import { get } from "k6/http";
import { check } from "k6";

export const options = {
  scenarios: {
    constant_request_rate: {
      executor: "constant-arrival-rate",
      rate: 450,
      timeUnit: "1s",
      duration: "1m",
      preAllocatedVUs: 200,
      maxVUs: 300,
    },
  },
};

export default function () {
  check(
    get(
      "https://api.whatever.com/reafactored-api"
    ),
    { "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