Skip to content

Commit

Permalink
bring back only using seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
vezenovm committed Dec 21, 2024
1 parent 52a7250 commit e0a9b8e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 32 deletions.
16 changes: 3 additions & 13 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,8 @@ const computeExecutionDiff = (refReports, executionReports, header) => {
if (refReports[i].artifact_name === executionReports[i].artifact_name) {
const compTimeString = executionReports[i].time;
const refTimeString = refReports[i].time;
const compTimeSegments = compTimeString.split("m");
const refTimeSegments = refTimeString.split("m");
const minutesString = compTimeSegments[0];
const refMinutesString = refTimeSegments[0];
const compMinutesValue = parseInt(minutesString);
const refMinutesValue = parseInt(refMinutesString);
const secondsString = compTimeSegments[1];
const compSecondsValue = parseFloat(secondsString.substring(0, secondsString.length - 1));
const compSeconds = compMinutesValue * 60 + compSecondsValue;
const refSecondsString = refTimeSegments[1];
const refSecondsValue = parseFloat(refSecondsString.substring(0, refSecondsString.length - 1));
const refSeconds = refMinutesValue * 60 + refSecondsValue;
const compSeconds = parseFloat(compTimeString.substring(0, compTimeString.length - 1));
const refSeconds = parseFloat(refTimeString.substring(0, refTimeString.length - 1));
const diff = Math.floor(((compSeconds - refSeconds) / refSeconds) * 100);
if (diff != 0) {
diff_column = true;
Expand Down Expand Up @@ -279,7 +269,7 @@ function run() {
try {
core.startGroup("Load reports");
referenceContent !== null && referenceContent !== void 0 ? referenceContent : (referenceContent = compareContent); // if no source reports were loaded, defaults to the current reports
core.info("About to check memory reports");
core.info("About to check reports");
const isMemoryReport = memory_report === "true";
const isExecutionReport = execution_report === "true";
if (isMemoryReport) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

19 changes: 2 additions & 17 deletions src/execution_report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,9 @@ export const computeExecutionDiff = (
if (refReports[i].artifact_name === executionReports[i].artifact_name) {
const compTimeString = executionReports[i].time;
const refTimeString = refReports[i].time;
const compTimeSegments = compTimeString.split("m");
const refTimeSegments = refTimeString.split("m");

const minutesString = compTimeSegments[0];
const refMinutesString = refTimeSegments[0];

const compMinutesValue = parseInt(minutesString);
const refMinutesValue = parseInt(refMinutesString);

const secondsString = compTimeSegments[1];
const compSecondsValue = parseFloat(secondsString.substring(0, secondsString.length - 1));
const compSeconds = compMinutesValue * 60 + compSecondsValue;

const refSecondsString = refTimeSegments[1];
const refSecondsValue = parseFloat(
refSecondsString.substring(0, refSecondsString.length - 1)
);
const refSeconds = refMinutesValue * 60 + refSecondsValue;
const compSeconds = parseFloat(compTimeString.substring(0, compTimeString.length - 1));
const refSeconds = parseFloat(refTimeString.substring(0, refTimeString.length - 1));

const diff = Math.floor(((compSeconds - refSeconds) / refSeconds) * 100);
if (diff != 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async function run() {
try {
core.startGroup("Load reports");
referenceContent ??= compareContent; // if no source reports were loaded, defaults to the current reports
core.info("About to check memory reports");
core.info("About to check reports");

const isMemoryReport = memory_report === "true";
const isExecutionReport = execution_report === "true";
Expand Down

0 comments on commit e0a9b8e

Please sign in to comment.