From c448e28e9f2dd723f215d3a22b52042af7889aa7 Mon Sep 17 00:00:00 2001 From: Gokul Premraj Date: Mon, 13 Mar 2023 13:12:30 -0400 Subject: [PATCH 1/3] Add logs for time taken for each RP schema generation --- generator/cmd/generateall.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generator/cmd/generateall.ts b/generator/cmd/generateall.ts index 9951ed14f6..b6e0617c68 100644 --- a/generator/cmd/generateall.ts +++ b/generator/cmd/generateall.ts @@ -91,7 +91,10 @@ executeSynchronous(async () => { const readme = validateAndReturnReadmePath(localPath, autoGenConfig.readmeFile || autoGenConfig.basePath); pkg.packageName = getPackageString(readme); + const startTime = Date.now(); const newConfigs = await generateSchemas(readme, autoGenConfig); + const generationTime = Date.now() - startTime; + console.log(`Time taken to generate ${autoGenConfig.basePath} : ${generationTime}.`) schemaConfigs.push(...newConfigs); pkg.result = 'succeeded'; logOut(summaryLogger, From 4d55003ac0e999a8460b2d766484104da29b707e Mon Sep 17 00:00:00 2001 From: Gokul Premraj Date: Mon, 13 Mar 2023 14:04:28 -0400 Subject: [PATCH 2/3] log statement edits --- generator/cmd/generateall.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/cmd/generateall.ts b/generator/cmd/generateall.ts index b6e0617c68..1ecb5b42e6 100644 --- a/generator/cmd/generateall.ts +++ b/generator/cmd/generateall.ts @@ -94,7 +94,7 @@ executeSynchronous(async () => { const startTime = Date.now(); const newConfigs = await generateSchemas(readme, autoGenConfig); const generationTime = Date.now() - startTime; - console.log(`Time taken to generate ${autoGenConfig.basePath} : ${generationTime}.`) + console.log(`Time taken to generate ${autoGenConfig.basePath} : ${generationTime} ms.`); schemaConfigs.push(...newConfigs); pkg.result = 'succeeded'; logOut(summaryLogger, From 61aedb09bfb4b9b0a8f6af98b82689f7a9b38e61 Mon Sep 17 00:00:00 2001 From: Gokul Premraj Date: Mon, 13 Mar 2023 15:57:27 -0400 Subject: [PATCH 3/3] Added colors to differenciate the log --- generator/cmd/generateall.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/cmd/generateall.ts b/generator/cmd/generateall.ts index 1ecb5b42e6..2cb780b741 100644 --- a/generator/cmd/generateall.ts +++ b/generator/cmd/generateall.ts @@ -94,7 +94,7 @@ executeSynchronous(async () => { const startTime = Date.now(); const newConfigs = await generateSchemas(readme, autoGenConfig); const generationTime = Date.now() - startTime; - console.log(`Time taken to generate ${autoGenConfig.basePath} : ${generationTime} ms.`); + console.log(`Time taken to generate ${chalk.green.italic(autoGenConfig.basePath)} : ${chalk.magenta.bold(generationTime)} ms.`); schemaConfigs.push(...newConfigs); pkg.result = 'succeeded'; logOut(summaryLogger,