Skip to content

Commit

Permalink
Refactor the whole project: All settings is done via new TEST SETTING…
Browse files Browse the repository at this point in the history
…S section
  • Loading branch information
farshaddavoudi committed Aug 2, 2024
1 parent 10da813 commit c58a4be
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 279 deletions.
4 changes: 2 additions & 2 deletions HtmlReporter.js

Large diffs are not rendered by default.

45 changes: 26 additions & 19 deletions helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,22 @@ export const usersCapacityCalPhases = (scenario) => {

let totalPhasesDurationInMinutes = totalPhasesDuration / 60;

console.log("USERs CAPACITY CALCs CONFIGs:");

if (isConfigured) {
phases.forEach((phase, index) => {
console.log(
`Phase ${index + 1} starts at ${phase.phaseStart} seconds and ends at ${
phase.phaseEnd
} seconds with a target of ${phase.phaseTarget} VUs`
);
});
console.log(
`Total duration of users capacity phases is: ${totalPhasesDurationInMinutes} minutes`
);
} else {
console.log(
"This scenario is not configured for user capacity calculation."
);
}

return { phases, isConfigured, totalPhasesDurationInMinutes };
};

export const logUsersCapacityPhases = (usersCapacityPhases) => {
console.log("USERs CAPACITY CALCs CONFIGs:");

if (usersCapacityPhases.isConfigured) {
usersCapacityPhases.phases.forEach((phase, index) => {
console.log(`Phase ${index + 1} starts at ${phase.phaseStart} seconds and ends at ${phase.phaseEnd} seconds with a target of ${phase.phaseTarget} VUs`);
});
console.log(`Total duration of users capacity phases is: ${usersCapacityPhases.totalPhasesDurationInMinutes} minutes`);
} else {
console.log("This scenario is not configured for user capacity calculation.");
}
};

const parseDuration = (duration) => {
let time = parseInt(duration.slice(0, -1));
let unit = duration.slice(-1);
Expand All @@ -54,3 +48,16 @@ const parseDuration = (duration) => {
return 0;
}
};

function arraysEqual(arr1, arr2) {
if (arr1.length !== arr2.length) {
return false;
}
for (let i = 0; i < arr1.length; i++) {
if (arr1[i] !== arr2[i]) {
return false;
}
}
return true;
}

Loading

0 comments on commit c58a4be

Please sign in to comment.