IO-3017 Lifecycle Average Time

Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
Allan Carr
2024-11-07 13:56:53 -08:00
parent 5fce548666
commit 624f8e77cb
5 changed files with 24 additions and 7 deletions

View File

@@ -81,13 +81,17 @@ const jobLifecycle = async (req, res) => {
const percentage = (value / finalTotal) * 100;
const color = getLifecycleStatusColor(status);
const roundedPercentage = `${Math.round(percentage)}%`;
const averageValue = value / jobIDs.length;
const averageHumanReadable = durationToHumanReadable(moment.duration(averageValue));
finalSummations.push({
status,
value,
humanReadable,
percentage,
color,
roundedPercentage
roundedPercentage,
averageValue,
averageHumanReadable
});
});
@@ -100,7 +104,9 @@ const jobLifecycle = async (req, res) => {
totalStatuses: finalSummations.length,
total: finalTotal,
statusCounts: finalStatusCounts,
humanReadable: durationToHumanReadable(moment.duration(finalTotal))
humanReadable: durationToHumanReadable(moment.duration(finalTotal)),
averageValue: finalTotal / jobIDs.length,
averageHumanReadable: durationToHumanReadable(moment.duration(finalTotal / jobIDs.length))
}
});
};