feature/IO-3017-Lifecycle-Average-Time - Small fixes
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -81,7 +81,7 @@ const jobLifecycle = async (req, res) => {
|
|||||||
const percentage = finalTotal > 0 ? (value / finalTotal) * 100 : 0;
|
const percentage = finalTotal > 0 ? (value / finalTotal) * 100 : 0;
|
||||||
const color = getLifecycleStatusColor(status);
|
const color = getLifecycleStatusColor(status);
|
||||||
const roundedPercentage = `${Math.round(percentage)}%`;
|
const roundedPercentage = `${Math.round(percentage)}%`;
|
||||||
const averageValue = _size(jobIDs) > 0 ? value / jobIDs.length : 0;
|
const averageValue = _.size(jobIDs) > 0 ? value / jobIDs.length : 0;
|
||||||
const averageHumanReadable = durationToHumanReadable(moment.duration(averageValue));
|
const averageHumanReadable = durationToHumanReadable(moment.duration(averageValue));
|
||||||
finalSummations.push({
|
finalSummations.push({
|
||||||
status,
|
status,
|
||||||
@@ -105,9 +105,9 @@ const jobLifecycle = async (req, res) => {
|
|||||||
total: finalTotal,
|
total: finalTotal,
|
||||||
statusCounts: finalStatusCounts,
|
statusCounts: finalStatusCounts,
|
||||||
humanReadable: durationToHumanReadable(moment.duration(finalTotal)),
|
humanReadable: durationToHumanReadable(moment.duration(finalTotal)),
|
||||||
averageValue: _size(jobIDs) > 0 ? finalTotal / jobIDs.length : 0,
|
averageValue: _.size(jobIDs) > 0 ? finalTotal / jobIDs.length : 0,
|
||||||
averageHumanReadable:
|
averageHumanReadable:
|
||||||
_size(jobIDs) > 0
|
_.size(jobIDs) > 0
|
||||||
? durationToHumanReadable(moment.duration(finalTotal / jobIDs.length))
|
? durationToHumanReadable(moment.duration(finalTotal / jobIDs.length))
|
||||||
: durationToHumanReadable(moment.duration(0))
|
: durationToHumanReadable(moment.duration(0))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user