@@ -11,21 +11,12 @@ export class ClientLogWatcher {
11
11
private context : vscode . ExtensionContext ;
12
12
private javaExtensionRoot : vscode . Uri | undefined ;
13
13
private logProcessedTimestamp : number = Date . now ( ) ;
14
- private interestedLspRequests : string [ ] = [ "textDocument\\/completion" ] ;
15
- private lspTracePatterns : Map < string , RegExp > = new Map ( ) ;
16
- // statistics of the interested lsp requests.
17
- private perfTraces : Map < string , { time : number ; count : number } > = new Map ( ) ;
18
14
19
15
constructor ( daemon : LSDaemon ) {
20
16
this . context = daemon . context ;
21
17
if ( this . context . storageUri ) {
22
18
this . javaExtensionRoot = vscode . Uri . joinPath ( this . context . storageUri , ".." , "redhat.java" ) ;
23
19
}
24
- if ( this . interestedLspRequests . length > 0 ) {
25
- for ( const request of this . interestedLspRequests ) {
26
- this . lspTracePatterns . set ( request , new RegExp ( `\\[Trace.*\\] Received response \'${ request } .*\' in (\\d+)ms` ) ) ;
27
- }
28
- }
29
20
}
30
21
31
22
public async collectInfoFromLog ( ) {
@@ -73,33 +64,9 @@ export class ClientLogWatcher {
73
64
name : "client-log-startup-metadata" ,
74
65
...info
75
66
} ) ;
76
- } else {
77
- for ( const key of this . lspTracePatterns . keys ( ) ) {
78
- const regexp : RegExp = this . lspTracePatterns . get ( key ) ! ;
79
- const match = log . message ?. match ( regexp ) ;
80
- if ( match ?. length === 2 ) {
81
- const time = parseInt ( match [ 1 ] ) ;
82
- if ( Number . isNaN ( time ) ) {
83
- continue ;
84
- }
85
- let statistics : { time : number ; count : number ; } | undefined = this . perfTraces . get ( key ) ;
86
- if ( ! statistics ) {
87
- statistics = {
88
- time,
89
- count : 1 ,
90
- } ;
91
- } else {
92
- statistics . time += time ;
93
- statistics . count ++ ;
94
- }
95
- this . perfTraces . set ( key , statistics ) ;
96
- }
97
- }
98
67
}
99
68
}
100
69
}
101
-
102
- this . sendPerfStatistics ( ) ;
103
70
}
104
71
105
72
public async getLogs ( ) {
@@ -131,17 +98,6 @@ export class ClientLogWatcher {
131
98
}
132
99
return undefined ;
133
100
}
134
-
135
- private sendPerfStatistics ( ) {
136
- for ( let [ key , value ] of this . perfTraces ) {
137
- sendInfo ( "" , {
138
- name : "perf-trace" ,
139
- kind : escapeLspRequestName ( key ) ,
140
- time : value . time ,
141
- count : value . count ,
142
- } ) ;
143
- }
144
- }
145
101
}
146
102
/**
147
103
* filename: client.log.yyyy-mm-dd.r
@@ -187,10 +143,3 @@ function parse(rawLog: string) {
187
143
}
188
144
return ret ;
189
145
}
190
-
191
- /**
192
- * To avoid the LSP request name get redacted.
193
- */
194
- function escapeLspRequestName ( name : string ) {
195
- return name . replace ( "\\/" , "-" ) ;
196
- }
0 commit comments