@@ -7,23 +7,39 @@ import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle
77import { Registry } from 'vs/platform/registry/common/platform' ;
88import { Extensions , IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions' ;
99import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
10+ import { posix } from 'vs/base/common/path' ;
11+ import { hash } from 'vs/base/common/hash' ;
1012
1113class ResourcePerformanceMarks {
1214
1315 constructor ( @ITelemetryService telemetryService : ITelemetryService ) {
1416
15- type Entry = { name : string ; duration : number } ;
17+ type Entry = {
18+ hosthash : string ;
19+ name : string ;
20+ duration : number ;
21+ } ;
1622 type EntryClassifify = {
1723 owner : 'jrieken' ;
1824 comment : 'Resource performance numbers' ;
19- name : { classification : 'SystemMetaData' ; purpose : 'PerformanceAndHealth' ; comment : 'Resource name' } ;
25+ hosthash : { classification : 'SystemMetaData' ; purpose : 'PerformanceAndHealth' ; comment : 'Hash of the hostname' } ;
26+ name : { classification : 'SystemMetaData' ; purpose : 'PerformanceAndHealth' ; comment : 'Resource basename' } ;
2027 duration : { classification : 'SystemMetaData' ; purpose : 'PerformanceAndHealth' ; isMeasurement : true ; comment : 'Resource duration' } ;
2128 } ;
2229 for ( const item of performance . getEntriesByType ( 'resource' ) ) {
23- telemetryService . publicLog2 < Entry , EntryClassifify > ( 'startup.resource.perf' , {
24- name : item . name ,
25- duration : item . duration
26- } ) ;
30+
31+ try {
32+ const url = new URL ( item . name ) ;
33+ const name = posix . basename ( url . pathname ) ;
34+
35+ telemetryService . publicLog2 < Entry , EntryClassifify > ( 'startup.resource.perf' , {
36+ hosthash : `H${ hash ( url . host ) . toString ( 16 ) } ` ,
37+ name,
38+ duration : item . duration
39+ } ) ;
40+ } catch {
41+ // ignore
42+ }
2743 }
2844 }
2945}
0 commit comments