mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Add telemetry for all commands (#6025)
This commit is contained in:
@@ -9,15 +9,20 @@ import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
|||||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
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 {
|
export class SqlTelemetryContribution extends Disposable implements IWorkbenchContribution {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@ITelemetryService private telemetryService: ITelemetryService,
|
@ITelemetryService private telemetryService: ITelemetryService,
|
||||||
@IStorageService storageService: IStorageService
|
@IStorageService storageService: IStorageService,
|
||||||
|
@ICommandService commandService: ICommandService
|
||||||
) {
|
) {
|
||||||
super();
|
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 dailyLastUseDate: number = Date.parse(storageService.get('telemetry.dailyLastUseDate', StorageScope.GLOBAL, '0'));
|
||||||
const weeklyLastUseDate: number = Date.parse(storageService.get('telemetry.weeklyLastUseDate', 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'));
|
const monthlyLastUseDate: number = Date.parse(storageService.get('telemetry.monthlyLastUseDate', StorageScope.GLOBAL, '0'));
|
||||||
|
|||||||
Reference in New Issue
Block a user