diff --git a/src/sql/platform/telemetry/telemetry.contribution.ts b/src/sql/platform/telemetry/telemetry.contribution.ts index 275307c4fd..1436323cdc 100644 --- a/src/sql/platform/telemetry/telemetry.contribution.ts +++ b/src/sql/platform/telemetry/telemetry.contribution.ts @@ -9,15 +9,20 @@ import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { Disposable } from 'vs/base/common/lifecycle'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import { ICommandService, ICommandEvent } from 'vs/platform/commands/common/commands'; export class SqlTelemetryContribution extends Disposable implements IWorkbenchContribution { constructor( @ITelemetryService private telemetryService: ITelemetryService, - @IStorageService storageService: IStorageService + @IStorageService storageService: IStorageService, + @ICommandService commandService: ICommandService ) { super(); + this._register( + commandService.onWillExecuteCommand( + (e: ICommandEvent) => 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'));