Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import http from "k6/http";
import { Counter } from "k6/metrics";
import { check } from "k6";
let headerFile = open("../example/header.html", "b");
let pageFile = open("../example/page.html", "b");
let failCounter = new Counter("failed requests");
export let options = {
stages: [{ duration: __ENV.DURATION || "5m", target: __ENV.MAX_VUS }],
thresholds: {
"failed requests": [
{
threshold: "count<1",
abortOnFail: true,
},
],
},
};
export default function () {
let data = {
headerTemplate: http.file(headerFile, "header.html"),
import http from "k6/http";
import { Counter } from "k6/metrics";
import { check } from "k6";
let headerFile = open("../example/header.html", "b");
let failCounter = new Counter("failed requests");
export let options = {
stages: [{ duration: "5m", target: __ENV.MAX_VUS }],
thresholds: {
"failed requests": [
{
threshold: "count<1",
abortOnFail: true,
},
],
},
};
export default function () {
let data = {
headerTemplate: http.file(headerFile, "header.html"),