From 1b8ce8d8e8ba57c844c39064485de3b1839b6bd9 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Fri, 9 Apr 2021 13:55:59 -0700 Subject: [PATCH] Added timing for job costing. --- bodyshop_translations.babel | 2 +- client/src/translations/en_us/common.json | 4 ++-- client/src/translations/es/common.json | 2 +- client/src/translations/fr/common.json | 2 +- server/job/job-costing.js | 11 +++++++++-- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 842c68575..c14b01a12 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -11366,7 +11366,7 @@ - validations + validation unique_employee_number diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 4330cd513..5a46059b2 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -735,7 +735,7 @@ "delete": "Employee deleted successfully.", "save": "Employee saved successfully." }, - "validations": { + "validation": { "unique_employee_number": "You must enter a unique employee number." } }, @@ -828,7 +828,7 @@ }, "messages": { "exception": "$t(titles.app) has encountered an error. Please try again. If the problem persists, please submit a support ticket or contact us.", - "newversionmessage": "Click refresh below to update to the latest available version of ImEX Online.", + "newversionmessage": "Click refresh below to update to the latest available version of ImEX Online. Please make sure all other tabs and windows are closed.", "newversiontitle": "New version of ImEX Online Available", "noacctfilepath": "There is no accounting file path set. You will not be able to export any items.", "noshop": "You do not have access to any shops. Please reach out to your shop manager or technical support. ", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 75e1655b4..ac07d094c 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -735,7 +735,7 @@ "delete": "Empleado eliminado con éxito.", "save": "Empleado guardado con éxito." }, - "validations": { + "validation": { "unique_employee_number": "" } }, diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 69bcb7fed..186219ea4 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -735,7 +735,7 @@ "delete": "L'employé a bien été supprimé.", "save": "L'employé a enregistré avec succès." }, - "validations": { + "validation": { "unique_employee_number": "" } }, diff --git a/server/job/job-costing.js b/server/job/job-costing.js index c08c0360f..ed9a50145 100644 --- a/server/job/job-costing.js +++ b/server/job/job-costing.js @@ -11,6 +11,7 @@ Dinero.globalRoundingMode = "HALF_EVEN"; async function JobCosting(req, res) { const { jobid } = req.body; console.log("🚀 ~ file: job-costing.js ~ line 13 ~ jobid", jobid); + console.time("querydata"); const BearerToken = req.headers.authorization; const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, { @@ -25,8 +26,11 @@ async function JobCosting(req, res) { .request(queries.QUERY_JOB_COSTING_DETAILS, { id: jobid, }); + console.timeEnd("querydata"); + console.time(`generatecostingdata-${resp.jobs_by_pk.id}`); const ret = GenerateCostingData(resp.jobs_by_pk); + console.timeEnd(`generatecostingdata-${resp.jobs_by_pk.id}`); res.status(200).json(ret); } catch (error) { @@ -37,9 +41,8 @@ async function JobCosting(req, res) { async function JobCostingMulti(req, res) { const { jobids } = req.body; - console.log("🚀 ~ file: job-costing.js ~ line 13 ~ jobids", jobids); const BearerToken = req.headers.authorization; - + console.time("JobCostingMultiQueryExecution"); const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, { headers: { Authorization: BearerToken, @@ -56,9 +59,13 @@ async function JobCostingMulti(req, res) { //for Each!*************** const ret = {}; resp.jobs.map((job) => { + console.time(`CostingData-${job.id}`); ret[job.id] = GenerateCostingData(job); + console.timeEnd(`CostingData-${job.id}`); }); + console.timeEnd("JobCostingMultiQueryExecution"); + res.status(200).json(ret); } catch (error) { console.log("error", error);