Skip to content

Commit

Permalink
#162: print time it took to execute retrieve and deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Jul 26, 2023
1 parent e1cc77d commit 3af63d0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class Mcdev {
* @returns {Promise.<object>} -
*/
static async retrieve(businessUnit, selectedTypesArr, keys, changelogOnly) {
console.time('Time'); // eslint-disable-line no-console
Util.startLogger();
Util.logger.info('mcdev:: Retrieve');
const properties = await config.getProperties();
Expand Down Expand Up @@ -247,6 +248,7 @@ class Mcdev {
changelogOnly
);
if (changelogOnly) {
console.timeEnd('Time'); // eslint-disable-line no-console
return retrieveChangelog;
} else {
resultsObj[`${cred}/${bu}`] = retrieveChangelog;
Expand All @@ -267,6 +269,7 @@ class Mcdev {
resultsObj[credBu][type] = resultsObj[credBu][type][0];
}
}
console.timeEnd('Time'); // eslint-disable-line no-console

return resultsObj;
}
Expand Down Expand Up @@ -390,8 +393,11 @@ class Mcdev {
* @returns {Promise.<Object.<string,TYPE.MultiMetadataTypeMap>>} deployed metadata per BU (first key: bu name, second key: metadata type)
*/
static async deploy(businessUnit, selectedTypesArr, keyArr) {
console.time('Time'); // eslint-disable-line no-console
Util.startLogger();
return Deployer.deploy(businessUnit, selectedTypesArr, keyArr);
const deployResult = await Deployer.deploy(businessUnit, selectedTypesArr, keyArr);
console.timeEnd('Time'); // eslint-disable-line no-console
return deployResult;
}

/**
Expand Down

0 comments on commit 3af63d0

Please sign in to comment.