Filter out high frequency command events (#6102)

This commit is contained in:
Charles Gagnon
2019-06-19 19:45:11 +00:00
committed by GitHub
parent 639efbcfad
commit 7a689b93db

View File

@@ -22,7 +22,12 @@ export class SqlTelemetryContribution extends Disposable implements IWorkbenchCo
this._register(
commandService.onWillExecuteCommand(
(e: ICommandEvent) => telemetryService.publicLog('adsCommandExecuted', { id: e.commandId })));
(e: ICommandEvent) => {
// Filter out high-frequency events
if (!['type'].find(id => id === e.commandId)) {
telemetryService.publicLog('adsCommandExecuted', { id: e.commandId });
}
}));
const dailyLastUseDate: number = Date.parse(storageService.get('telemetry.dailyLastUseDate', StorageScope.GLOBAL, '0'));
const weeklyLastUseDate: number = Date.parse(storageService.get('telemetry.weeklyLastUseDate', StorageScope.GLOBAL, '0'));
const monthlyLastUseDate: number = Date.parse(storageService.get('telemetry.monthlyLastUseDate', StorageScope.GLOBAL, '0'));