Skip to content

Commit 2155320

Browse files
committed
Use composition instead
1 parent 8aa17c5 commit 2155320

File tree

1 file changed

+17
-39
lines changed

1 file changed

+17
-39
lines changed

src/vs/workbench/contrib/performance/browser/inputLatencyContrib.ts

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -43,53 +43,31 @@ export class InputLatencyContrib extends Disposable implements IWorkbenchContrib
4343
return;
4444
}
4545

46+
type InputLatencyStatisticFragment = {
47+
owner: 'tyriar';
48+
comment: 'Represents a set of statistics collected about input latencies';
49+
average: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The average time it took to execute.'; isMeasurement: true };
50+
max: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The maximum time it took to execute.'; isMeasurement: true };
51+
min: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The minimum time it took to execute.'; isMeasurement: true };
52+
};
53+
4654
type PerformanceInputLatencyClassification = {
4755
owner: 'tyriar';
4856
comment: 'This is a set of samples of the time (in milliseconds) that various events took when typing in the editor';
49-
'keydown.average': { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The min time it took for the keydown event to execute.' };
50-
'keydown.max': { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The max time it took for the keydown event to execute.' };
51-
'keydown.min': { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The average time it took for the keydown event to execute.' };
52-
'input.average': { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The min time it took for the input event to execute.' };
53-
'input.max': { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The max time it took for the input event to execute.' };
54-
'input.min': { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The average time it took for the input event to execute.' };
55-
'render.average': { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The min time it took for the render animation frame to execute.' };
56-
'render.max': { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The max time it took for the render animation frame to execute.' };
57-
'render.min': { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The average time it took for the render animation frame to execute.' };
58-
'total.average': { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The min input latency.' };
59-
'total.max': { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The max input latency.' };
60-
'total.min': { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The average input latency.' };
57+
keydown: InputLatencyStatisticFragment;
58+
input: InputLatencyStatisticFragment;
59+
render: InputLatencyStatisticFragment;
60+
total: InputLatencyStatisticFragment;
6161
sampleCount: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The number of samples measured.' };
6262
};
6363

64-
type PerformanceInputLatencyEvent = {
65-
'keydown.average': number;
66-
'keydown.max': number;
67-
'keydown.min': number;
68-
'input.average': number;
69-
'input.max': number;
70-
'input.min': number;
71-
'render.average': number;
72-
'render.max': number;
73-
'render.min': number;
74-
'total.average': number;
75-
'total.max': number;
76-
'total.min': number;
77-
sampleCount: number;
78-
};
64+
type PerformanceInputLatencyEvent = inputLatency.IInputLatencyMeasurements;
7965

8066
this._telemetryService.publicLog2<PerformanceInputLatencyEvent, PerformanceInputLatencyClassification>('performance.inputLatency', {
81-
'keydown.average': measurements.keydown.average,
82-
'keydown.max': measurements.keydown.max,
83-
'keydown.min': measurements.keydown.min,
84-
'input.average': measurements.input.average,
85-
'input.max': measurements.input.max,
86-
'input.min': measurements.input.min,
87-
'render.average': measurements.render.average,
88-
'render.max': measurements.render.max,
89-
'render.min': measurements.render.min,
90-
'total.average': measurements.total.average,
91-
'total.max': measurements.total.max,
92-
'total.min': measurements.total.min,
67+
keydown: measurements.keydown,
68+
input: measurements.input,
69+
render: measurements.render,
70+
total: measurements.total,
9371
sampleCount: measurements.sampleCount
9472
});
9573
}

0 commit comments

Comments
 (0)