Skip to content

Commit

Permalink
fix: clarify performance debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Nov 8, 2023
1 parent 2e360e7 commit 745028e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/performance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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')

Expand Down

0 comments on commit 745028e

Please sign in to comment.