From 745028eebb15dc095110f834e3f0f14d1e27ee47 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Wed, 8 Nov 2023 13:49:38 -0700 Subject: [PATCH] fix: clarify performance debug logs --- src/performance.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/performance.ts b/src/performance.ts index 004a42eb4..519d70801 100644 --- a/src/performance.ts +++ b/src/performance.ts @@ -194,7 +194,9 @@ export class Performance { if (!Performance.enabled) return const oclifDebug = require('debug')('oclif-perf') - oclifDebug('Total Time: %sms', Performance.oclifPerf['oclif.runMs'].toFixed(4)) + const processUpTime = (process.uptime() * 1000).toFixed(4) + oclifDebug('Process Uptime: %sms', processUpTime) + oclifDebug('Oclif Time: %sms', Performance.oclifPerf['oclif.runMs'].toFixed(4)) oclifDebug('Init Time: %sms', Performance.oclifPerf['oclif.initMs'].toFixed(4)) oclifDebug('Config Load Time: %sms', Performance.oclifPerf['oclif.configLoadMs'].toFixed(4)) oclifDebug( @@ -227,6 +229,11 @@ export class Performance { oclifDebug('Command Load Time: %sms', Performance.oclifPerf['oclif.commandLoadMs'].toFixed(4)) oclifDebug('Command Run Time: %sms', Performance.oclifPerf['oclif.commandRunMs'].toFixed(4)) + if (Performance.oclifPerf['oclif.configLoadMs'] > Performance.oclifPerf['oclif.runMs']) { + oclifDebug( + '! Config load time is greater than total time. This might mean that Config was instantiated before oclif was run.', + ) + } const nonCoreDebug = require('debug')('non-oclif-perf')