♻️Made performance test runnable

This commit is contained in:
Anton SHEPILOV
2025-02-03 17:12:29 +01:00
committed by Anton Shepilov
parent 6002974306
commit 47106a8459
3 changed files with 37 additions and 2 deletions
@@ -13,7 +13,7 @@ export let options = {
{ duration: "10s", target: 0 },
],
thresholds: {
upload_duration: ["p(95)<17000"], // 95% of uploads should be faster than 500ms
upload_duration: ["p(95)<500"], // 95% of uploads should be faster than 500ms
},
};
@@ -29,7 +29,7 @@ function uploadFile(filePath, fileType, JWT, companyID) {
const formData = new FormData();
const randomInt = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
const fileName = `${randomInt.toString(36)}.${fileType.split("/")[1]}`; // Extract extension from MIME type
formData.append("file", http.file(open(filePath), fileName, fileType));
formData.append("file", http.file(filePath, fileName, fileType));
const headers = {
Authorization: `Bearer ${JWT}`,
@@ -56,5 +56,7 @@ export default function () {
"company_id is present": body => body.resource.company_id !== undefined,
});
sleep(1);
}