@@ -45,6 +45,39 @@ export interface IExtensionsStatus {
4545 activationTimes : ActivationTimes ;
4646}
4747
48+ /**
49+ * e.g.
50+ * {
51+ * startTime: 1511954813493000,
52+ * endTime: 1511954835590000,
53+ * deltas: [ 100, 1500, 123456, 1500, 100000 ],
54+ * ids: [ 'idle', 'self', 'extension1', 'self', 'idle' ]
55+ * }
56+ */
57+ export interface IExtensionHostProfile {
58+ /**
59+ * Profiling start timestamp in microseconds.
60+ */
61+ startTime : number ;
62+ /**
63+ * Profiling end timestamp in microseconds.
64+ */
65+ endTime : number ;
66+ /**
67+ * Duration of segment in microseconds.
68+ */
69+ deltas : number [ ] ;
70+ /**
71+ * Segment identifier: extension id or one of the four known strings.
72+ */
73+ ids : ( string | 'idle' | 'program' | 'gc' | 'self' ) [ ] ;
74+
75+ /**
76+ * Get the information as a .cpuprofile.
77+ */
78+ data : object ;
79+ }
80+
4881export class ActivationTimes {
4982 constructor (
5083 public readonly startup : boolean ,
@@ -116,6 +149,11 @@ export interface IExtensionService {
116149 */
117150 getExtensionsStatus ( ) : { [ id : string ] : IExtensionsStatus } ;
118151
152+ /**
153+ * Begin an extension host process profile session.
154+ */
155+ startExtensionHostProfile ( ) : ProfileSession ;
156+
119157 /**
120158 * Restarts the extension host.
121159 */
@@ -136,3 +174,9 @@ export interface IExtensionService {
136174 */
137175 getExtensionHostInformation ( ) : IExtensionHostInformation ;
138176}
177+
178+ export interface ProfileSession {
179+
180+ stop ( ) : TPromise < IExtensionHostProfile > ;
181+
182+ }
0 commit comments