IO-3017 Lifecycle Average Time
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { Card, Table, Tag } from "antd";
|
||||
import LoadingSkeleton from "../../loading-skeleton/loading-skeleton.component";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import dayjs from "../../../utils/day";
|
||||
import DashboardRefreshRequired from "../refresh-required.component";
|
||||
import axios from "axios";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import dayjs from "../../../utils/day";
|
||||
import LoadingSkeleton from "../../loading-skeleton/loading-skeleton.component";
|
||||
import DashboardRefreshRequired from "../refresh-required.component";
|
||||
|
||||
const fortyFiveDaysAgo = () => dayjs().subtract(45, "day").toLocaleString();
|
||||
|
||||
@@ -46,6 +46,11 @@ export default function JobLifecycleDashboardComponent({ data, bodyshop, ...card
|
||||
dataIndex: "humanReadable",
|
||||
key: "humanReadable"
|
||||
},
|
||||
{
|
||||
title: t("job_lifecycle.columns.average_human_readable"),
|
||||
dataIndex: "averageHumanReadable",
|
||||
key: "averageHumanReadable"
|
||||
},
|
||||
{
|
||||
title: t("job_lifecycle.columns.status_count"),
|
||||
key: "statusCount",
|
||||
|
||||
@@ -1338,6 +1338,8 @@
|
||||
},
|
||||
"job_lifecycle": {
|
||||
"columns": {
|
||||
"average_human_readable": "Average Human Readable",
|
||||
"average_value": "Average Value",
|
||||
"duration": "Duration",
|
||||
"end": "End",
|
||||
"human_readable": "Human Readable",
|
||||
|
||||
@@ -1338,6 +1338,8 @@
|
||||
},
|
||||
"job_lifecycle": {
|
||||
"columns": {
|
||||
"average_human_readable": "",
|
||||
"average_value": "",
|
||||
"duration": "",
|
||||
"end": "",
|
||||
"human_readable": "",
|
||||
|
||||
@@ -1338,6 +1338,8 @@
|
||||
},
|
||||
"job_lifecycle": {
|
||||
"columns": {
|
||||
"average_human_readable": "",
|
||||
"average_value": "",
|
||||
"duration": "",
|
||||
"end": "",
|
||||
"human_readable": "",
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user