@@ -38,19 +38,31 @@ export function computeStats(
38
38
lines . push ( `- I/O Handles Impact: total: ${ recursiveRequestsStatus . polling + nonRecursiveRequestsStatus . polling + recursiveWatcherStatus . active + nonRecursiveWatcherStatus . active } ` ) ;
39
39
40
40
lines . push ( `\n[Recursive Requests (${ allRecursiveRequests . length } , suspended: ${ recursiveRequestsStatus . suspended } , polling: ${ recursiveRequestsStatus . polling } )]:` ) ;
41
+ const recursiveRequestLines : string [ ] = [ ] ;
41
42
for ( const request of [ nonSuspendedRecursiveRequests , suspendedPollingRecursiveRequests , suspendedNonPollingRecursiveRequests ] . flat ( ) ) {
42
- fillRequestStats ( lines , request , recursiveWatcher ) ;
43
+ fillRequestStats ( recursiveRequestLines , request , recursiveWatcher ) ;
43
44
}
45
+ lines . push ( ...alignTextColumns ( recursiveRequestLines ) ) ;
44
46
45
- fillRecursiveWatcherStats ( lines , recursiveWatcher ) ;
47
+ const recursiveWatcheLines : string [ ] = [ ] ;
48
+ fillRecursiveWatcherStats ( recursiveWatcheLines , recursiveWatcher ) ;
49
+ lines . push ( ...alignTextColumns ( recursiveWatcheLines ) ) ;
46
50
47
51
lines . push ( `\n[Non-Recursive Requests (${ allNonRecursiveRequests . length } , suspended: ${ nonRecursiveRequestsStatus . suspended } , polling: ${ nonRecursiveRequestsStatus . polling } )]:` ) ;
52
+ const nonRecursiveRequestLines : string [ ] = [ ] ;
48
53
for ( const request of [ nonSuspendedNonRecursiveRequests , suspendedPollingNonRecursiveRequests , suspendedNonPollingNonRecursiveRequests ] . flat ( ) ) {
49
- fillRequestStats ( lines , request , nonRecursiveWatcher ) ;
54
+ fillRequestStats ( nonRecursiveRequestLines , request , nonRecursiveWatcher ) ;
50
55
}
56
+ lines . push ( ...alignTextColumns ( nonRecursiveRequestLines ) ) ;
51
57
52
- fillNonRecursiveWatcherStats ( lines , nonRecursiveWatcher ) ;
58
+ const nonRecursiveWatcheLines : string [ ] = [ ] ;
59
+ fillNonRecursiveWatcherStats ( nonRecursiveWatcheLines , nonRecursiveWatcher ) ;
60
+ lines . push ( ...alignTextColumns ( nonRecursiveWatcheLines ) ) ;
53
61
62
+ return `\n\n[File Watcher] request stats:\n\n${ lines . join ( '\n' ) } \n\n` ;
63
+ }
64
+
65
+ function alignTextColumns ( lines : string [ ] ) {
54
66
let maxLength = 0 ;
55
67
for ( const line of lines ) {
56
68
maxLength = Math . max ( maxLength , line . split ( '\t' ) [ 0 ] . length ) ;
@@ -65,7 +77,7 @@ export function computeStats(
65
77
}
66
78
}
67
79
68
- return `\n\n[File Watcher] request stats:\n\n ${ lines . join ( '\n' ) } \n\n` ;
80
+ return lines ;
69
81
}
70
82
71
83
function computeRequestStatus ( requests : IUniversalWatchRequest [ ] , watcher : ParcelWatcher | NodeJSWatcher ) : { suspended : number ; polling : number } {
0 commit comments