mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:28:52 +01:00
More granular telemetry API (#141086)
* Initial implementation of proposed telemetry API * TelemetryDetails -> TelemetryConfiguration + proposed guards
This commit is contained in:
@@ -303,11 +303,19 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
return extHostTerminalService.getDefaultShell(false);
|
||||
},
|
||||
get isTelemetryEnabled() {
|
||||
return extHostTelemetry.getTelemetryEnabled();
|
||||
return extHostTelemetry.getTelemetryConfiguration();
|
||||
},
|
||||
get onDidChangeTelemetryEnabled(): Event<boolean> {
|
||||
return extHostTelemetry.onDidChangeTelemetryEnabled;
|
||||
},
|
||||
get telemetryConfiguration(): vscode.TelemetryConfiguration {
|
||||
checkProposedApiEnabled(extension, 'telemetry');
|
||||
return extHostTelemetry.getTelemetryDetails();
|
||||
},
|
||||
get onDidChangeTelemetryConfiguration(): Event<vscode.TelemetryConfiguration> {
|
||||
checkProposedApiEnabled(extension, 'telemetry');
|
||||
return extHostTelemetry.onDidChangeTelemetryConfiguration;
|
||||
},
|
||||
get isNewAppInstall() {
|
||||
const installAge = Date.now() - new Date(initData.telemetryInfo.firstSessionDate).getTime();
|
||||
return isNaN(installAge) ? false : installAge < 1000 * 60 * 60 * 24; // install age is less than a day
|
||||
|
||||
Reference in New Issue
Block a user