Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add method to retrieve experiment values
  • Loading branch information
Kim-Adeline Miguel
Kim-Adeline Miguel committed Aug 20, 2020
commit bb10e88975813a6eb412c86390094a56299592f3
10 changes: 10 additions & 0 deletions src/client/common/experiments/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ export class ExperimentService implements IExperimentService {
return this.experimentationService.isCachedFlightEnabled(experiment);
}

public async getExperimentValue<T extends boolean | number | string>(
experimentName: string
): Promise<T | undefined> {
if (!this.experimentationService) {
return;
}

return this.experimentationService.getTreatmentVariableAsync('vscode', experimentName);
}

private logExperiments() {
const experiments = this.globalState.get<{ features: string[] }>(EXP_MEMENTO_KEY, { features: [] });

Expand Down
1 change: 1 addition & 0 deletions src/client/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ export interface IExperimentsManager {
export const IExperimentService = Symbol('IExperimentService');
export interface IExperimentService {
inExperiment(experimentName: string): Promise<boolean>;
getExperimentValue<T extends boolean | number | string>(experimentName: string): Promise<T | undefined>;
}

export type InterpreterConfigurationScope = { uri: Resource; configTarget: ConfigurationTarget };
Expand Down