mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-15 03:42:15 +01:00
adding load testing results
This commit is contained in:
@@ -1,9 +1,24 @@
|
||||
import http from "k6/http";
|
||||
import { Counter } from "k6/metrics";
|
||||
import { check } from "k6";
|
||||
|
||||
let pdf1File = open("../test/testdata/pdf/gotenberg.pdf", "b"),
|
||||
pdf2File = open("../test/testdata/pdf/gotenberg_bis.pdf", "b");
|
||||
|
||||
let failCounter = new Counter("failed requests");
|
||||
|
||||
export let options = {
|
||||
stages: [
|
||||
{ duration: "10m", target: __ENV.MAX_VUS }
|
||||
],
|
||||
thresholds: {
|
||||
"failed requests": [{
|
||||
threshold: "count<1",
|
||||
abortOnFail: true,
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
export default function() {
|
||||
var data = {
|
||||
"gotenberg.pdf": http.file(pdf1File, "gotenberg.pdf"),
|
||||
@@ -15,4 +30,7 @@ export default function() {
|
||||
"is not status 504": (r) => r.status !== 504,
|
||||
"is not status 500": (r) => r.status !== 500,
|
||||
});
|
||||
if (res.status !== 200) {
|
||||
failCounter.add(1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user