Added timing for job costing.
This commit is contained in:
@@ -11366,7 +11366,7 @@
|
|||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
<name>validations</name>
|
<name>validation</name>
|
||||||
<children>
|
<children>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>unique_employee_number</name>
|
<name>unique_employee_number</name>
|
||||||
|
|||||||
@@ -735,7 +735,7 @@
|
|||||||
"delete": "Employee deleted successfully.",
|
"delete": "Employee deleted successfully.",
|
||||||
"save": "Employee saved successfully."
|
"save": "Employee saved successfully."
|
||||||
},
|
},
|
||||||
"validations": {
|
"validation": {
|
||||||
"unique_employee_number": "You must enter a unique employee number."
|
"unique_employee_number": "You must enter a unique employee number."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -828,7 +828,7 @@
|
|||||||
},
|
},
|
||||||
"messages": {
|
"messages": {
|
||||||
"exception": "$t(titles.app) has encountered an error. Please try again. If the problem persists, please submit a support ticket or contact us.",
|
"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",
|
"newversiontitle": "New version of ImEX Online Available",
|
||||||
"noacctfilepath": "There is no accounting file path set. You will not be able to export any items.",
|
"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. ",
|
"noshop": "You do not have access to any shops. Please reach out to your shop manager or technical support. ",
|
||||||
|
|||||||
@@ -735,7 +735,7 @@
|
|||||||
"delete": "Empleado eliminado con éxito.",
|
"delete": "Empleado eliminado con éxito.",
|
||||||
"save": "Empleado guardado con éxito."
|
"save": "Empleado guardado con éxito."
|
||||||
},
|
},
|
||||||
"validations": {
|
"validation": {
|
||||||
"unique_employee_number": ""
|
"unique_employee_number": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -735,7 +735,7 @@
|
|||||||
"delete": "L'employé a bien été supprimé.",
|
"delete": "L'employé a bien été supprimé.",
|
||||||
"save": "L'employé a enregistré avec succès."
|
"save": "L'employé a enregistré avec succès."
|
||||||
},
|
},
|
||||||
"validations": {
|
"validation": {
|
||||||
"unique_employee_number": ""
|
"unique_employee_number": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ Dinero.globalRoundingMode = "HALF_EVEN";
|
|||||||
async function JobCosting(req, res) {
|
async function JobCosting(req, res) {
|
||||||
const { jobid } = req.body;
|
const { jobid } = req.body;
|
||||||
console.log("🚀 ~ file: job-costing.js ~ line 13 ~ jobid", jobid);
|
console.log("🚀 ~ file: job-costing.js ~ line 13 ~ jobid", jobid);
|
||||||
|
console.time("querydata");
|
||||||
const BearerToken = req.headers.authorization;
|
const BearerToken = req.headers.authorization;
|
||||||
|
|
||||||
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {
|
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {
|
||||||
@@ -25,8 +26,11 @@ async function JobCosting(req, res) {
|
|||||||
.request(queries.QUERY_JOB_COSTING_DETAILS, {
|
.request(queries.QUERY_JOB_COSTING_DETAILS, {
|
||||||
id: jobid,
|
id: jobid,
|
||||||
});
|
});
|
||||||
|
console.timeEnd("querydata");
|
||||||
|
|
||||||
|
console.time(`generatecostingdata-${resp.jobs_by_pk.id}`);
|
||||||
const ret = GenerateCostingData(resp.jobs_by_pk);
|
const ret = GenerateCostingData(resp.jobs_by_pk);
|
||||||
|
console.timeEnd(`generatecostingdata-${resp.jobs_by_pk.id}`);
|
||||||
|
|
||||||
res.status(200).json(ret);
|
res.status(200).json(ret);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -37,9 +41,8 @@ async function JobCosting(req, res) {
|
|||||||
|
|
||||||
async function JobCostingMulti(req, res) {
|
async function JobCostingMulti(req, res) {
|
||||||
const { jobids } = req.body;
|
const { jobids } = req.body;
|
||||||
console.log("🚀 ~ file: job-costing.js ~ line 13 ~ jobids", jobids);
|
|
||||||
const BearerToken = req.headers.authorization;
|
const BearerToken = req.headers.authorization;
|
||||||
|
console.time("JobCostingMultiQueryExecution");
|
||||||
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {
|
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: BearerToken,
|
Authorization: BearerToken,
|
||||||
@@ -56,9 +59,13 @@ async function JobCostingMulti(req, res) {
|
|||||||
//for Each!***************
|
//for Each!***************
|
||||||
const ret = {};
|
const ret = {};
|
||||||
resp.jobs.map((job) => {
|
resp.jobs.map((job) => {
|
||||||
|
console.time(`CostingData-${job.id}`);
|
||||||
ret[job.id] = GenerateCostingData(job);
|
ret[job.id] = GenerateCostingData(job);
|
||||||
|
console.timeEnd(`CostingData-${job.id}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.timeEnd("JobCostingMultiQueryExecution");
|
||||||
|
|
||||||
res.status(200).json(ret);
|
res.status(200).json(ret);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("error", error);
|
console.log("error", error);
|
||||||
|
|||||||
Reference in New Issue
Block a user