mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add ADS Startup Telemetry events back in (#4675)
They were removed with a VS Code merge. Changed to using extension contribution to log the telemetry to reduce the amount of VS code edits.
This commit is contained in:
@@ -168,42 +168,6 @@ export class Workbench extends Layout {
|
||||
}
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
/*
|
||||
private sendUsageEvents(telemetryService: ITelemetryService): void {
|
||||
const dailyLastUseDate = Date.parse(this.storageService.get('telemetry.dailyLastUseDate', StorageScope.GLOBAL, '0'));
|
||||
const weeklyLastUseDate = Date.parse(this.storageService.get('telemetry.weeklyLastUseDate', StorageScope.GLOBAL, '0'));
|
||||
const monthlyLastUseDate = Date.parse(this.storageService.get('telemetry.monthlyLastUseDate', StorageScope.GLOBAL, '0'));
|
||||
|
||||
let today = new Date().toUTCString();
|
||||
|
||||
// daily user event
|
||||
if (this.diffInDays(Date.parse(today), dailyLastUseDate) >= 1) {
|
||||
// daily first use
|
||||
telemetryService.publicLog('telemetry.dailyFirstUse', { dailyFirstUse: true });
|
||||
this.storageService.store('telemetry.dailyLastUseDate', today, StorageScope.GLOBAL);
|
||||
}
|
||||
|
||||
// weekly user event
|
||||
if (this.diffInDays(Date.parse(today), weeklyLastUseDate) >= 7) {
|
||||
// weekly first use
|
||||
telemetryService.publicLog('telemetry.weeklyFirstUse', { weeklyFirstUse: true });
|
||||
this.storageService.store('telemetry.weeklyLastUseDate', today, StorageScope.GLOBAL);
|
||||
}
|
||||
|
||||
// monthly user events
|
||||
if (this.diffInDays(Date.parse(today), monthlyLastUseDate) >= 30) {
|
||||
telemetryService.publicLog('telemetry.monthlyUse', { monthlyFirstUse: true });
|
||||
this.storageService.store('telemetry.monthlyLastUseDate', today, StorageScope.GLOBAL);
|
||||
}
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
private diffInDays(nowDate: number, lastUseDate: number): number {
|
||||
return (nowDate - lastUseDate) / (24 * 3600 * 1000);
|
||||
}
|
||||
*/
|
||||
|
||||
private initServices(serviceCollection: ServiceCollection): IInstantiationService {
|
||||
|
||||
// Layout Service
|
||||
|
||||
@@ -442,6 +442,7 @@ import 'sql/workbench/parts/dataExplorer/browser/dataExplorerViewlet';
|
||||
import 'sql/workbench/parts/dataExplorer/browser/dataExplorerExtensionPoint';
|
||||
import 'sql/workbench/parts/dataExplorer/electron-browser/nodeActions.contribution';
|
||||
|
||||
import 'sql/platform/telemetry/telemetry.contribution';
|
||||
import 'sql/workbench/parts/connection/electron-browser/connectionViewlet';
|
||||
import 'sql/workbench/api/node/sqlExtHost.contribution';
|
||||
import 'sql/parts/connection/common/connection.contribution';
|
||||
|
||||
Reference in New Issue
Block a user