@@ -417,11 +417,13 @@ class EggApplication extends EggCore {
417
417
const rundir = this . config . rundir ;
418
418
const dumpFile = path . join ( rundir , `${ this . type } _timing_${ process . pid } .json` ) ;
419
419
fs . writeFileSync ( dumpFile , CircularJSON . stringify ( items , null , 2 ) ) ;
420
+ this . coreLogger . info ( this . timing . toString ( ) ) ;
420
421
// only disable, not clear bootstrap timing data.
421
422
this . timing . disable ( ) ;
422
423
// show duration >= ${slowBootActionMinDuration}ms action to warnning log
423
424
for ( const item of items ) {
424
- if ( item . duration >= this . config . dump . timing . slowBootActionMinDuration ) {
425
+ // ignore #0 name: Process Start
426
+ if ( item . index > 0 && item . duration >= this . config . dump . timing . slowBootActionMinDuration ) {
425
427
this . coreLogger . warn ( '[egg:core][slow-boot-action] #%d %dms, name: %s' ,
426
428
item . index , item . duration , item . name ) ;
427
429
}
@@ -437,10 +439,11 @@ class EggApplication extends EggCore {
437
439
438
440
_setupTimeoutTimer ( ) {
439
441
const startTimeoutTimer = setTimeout ( ( ) => {
442
+ this . coreLogger . error ( this . timing . toString ( ) ) ;
440
443
this . coreLogger . error ( `${ this . type } still doesn't ready after ${ this . config . workerStartTimeout } ms.` ) ;
441
444
// log unfinished
442
- const json = this . timing . toJSON ( ) ;
443
- for ( const item of json ) {
445
+ const items = this . timing . toJSON ( ) ;
446
+ for ( const item of items ) {
444
447
if ( item . end ) continue ;
445
448
this . coreLogger . error ( `unfinished timing item: ${ CircularJSON . stringify ( item ) } ` ) ;
446
449
}
0 commit comments