Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/client/common/experiments/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,19 @@ export class ExperimentService implements IExperimentService {

private logExperiments() {
const telemetrySettings = this.workspaceService.getConfiguration('telemetry');
let experimentsDisabled = false;
if (telemetrySettings && telemetrySettings.get<boolean>('enableTelemetry') === false) {
this.output.appendLine('Telemetry is disabled');
this.output.appendLine('Experiments are disabled');
return;
experimentsDisabled = true;
}

if (telemetrySettings && telemetrySettings.get<string>('telemetryLevel') === 'off') {
this.output.appendLine('Telemetry level is off');
this.output.appendLine('Experiments are disabled');
return;
experimentsDisabled = true;
}

if (experimentsDisabled) {
this.output.appendLine('Experiments are disabled, logging experiments for info.');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karthiknadig Wait, doesn't this mean experiments from storage are still logged if telemetry is disabled? I think we should only log experiment from settings, but not log experiments from storage if telemetry is disabled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the end of the day, all we need to know is that experiments are disabled. Everything else is just for info. What is the benefit of skipping the stored details?

Copy link

@karrtikr karrtikr Nov 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually opted in/out experiments are still valid even though telemetry is disabled, so we should only be logging experiments from settings.

}

if (this._optOutFrom.includes('All')) {
Expand Down