Skip to content

Commit

Permalink
Merge pull request #166619 from microsoft/tyriar/input_latency_class
Browse files Browse the repository at this point in the history
Flatten input latency telemetry event
  • Loading branch information
Tyriar authored Nov 17, 2022
2 parents 9dd6dc2 + 2155320 commit 1fa7760
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,32 @@ export class InputLatencyContrib extends Disposable implements IWorkbenchContrib
return;
}

type InputLatencyStatisticFragment = {
owner: 'tyriar';
comment: 'Represents a set of statistics collected about input latencies';
average: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The average time it took to execute.'; isMeasurement: true };
max: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The maximum time it took to execute.'; isMeasurement: true };
min: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The minimum time it took to execute.'; isMeasurement: true };
};

type PerformanceInputLatencyClassification = {
owner: 'tyriar';
comment: 'This is a set of samples of the time (in milliseconds) that various events took when typing in the editor';
keydown: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The min, max and average time it took for the keydown event to execute.' };
input: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The min, max and average time it took for the input event to execute.' };
render: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The min, max and average time it took for the render animation frame to execute.' };
total: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The min, max and average input latency.' };
keydown: InputLatencyStatisticFragment;
input: InputLatencyStatisticFragment;
render: InputLatencyStatisticFragment;
total: InputLatencyStatisticFragment;
sampleCount: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The number of samples measured.' };
};

type PerformanceInputLatencyEvent = inputLatency.IInputLatencyMeasurements;

this._telemetryService.publicLog2<PerformanceInputLatencyEvent, PerformanceInputLatencyClassification>('performance.inputLatency', measurements);
this._telemetryService.publicLog2<PerformanceInputLatencyEvent, PerformanceInputLatencyClassification>('performance.inputLatency', {
keydown: measurements.keydown,
input: measurements.input,
render: measurements.render,
total: measurements.total,
sampleCount: measurements.sampleCount
});
}
}

0 comments on commit 1fa7760

Please sign in to comment.