From 3b19432974974c4dd103f5eb88473eb816ea63c1 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Fri, 8 Nov 2024 09:32:58 -0800 Subject: [PATCH] feature/IO-3017-Lifecycle-Average-Time - Small fixes Signed-off-by: Dave Richer --- server/job/job-lifecycle.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/job/job-lifecycle.js b/server/job/job-lifecycle.js index ddd58a834..7076069f6 100644 --- a/server/job/job-lifecycle.js +++ b/server/job/job-lifecycle.js @@ -81,7 +81,7 @@ const jobLifecycle = async (req, res) => { const percentage = finalTotal > 0 ? (value / finalTotal) * 100 : 0; const color = getLifecycleStatusColor(status); 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)); finalSummations.push({ status, @@ -105,9 +105,9 @@ const jobLifecycle = async (req, res) => { total: finalTotal, statusCounts: finalStatusCounts, humanReadable: durationToHumanReadable(moment.duration(finalTotal)), - averageValue: _size(jobIDs) > 0 ? finalTotal / jobIDs.length : 0, + averageValue: _.size(jobIDs) > 0 ? finalTotal / jobIDs.length : 0, averageHumanReadable: - _size(jobIDs) > 0 + _.size(jobIDs) > 0 ? durationToHumanReadable(moment.duration(finalTotal / jobIDs.length)) : durationToHumanReadable(moment.duration(0)) }