Share via


ExperimentationService Class

Definition

Experimentation service to provide functionality of A/B experiments:

  • reading flights;
  • caching current set of flights;
  • get answer on if flights are enabled.
public ref class ExperimentationService sealed : Microsoft::VisualStudio::Telemetry::TelemetryDisposableObject, IDisposable, Microsoft::VisualStudio::Experimentation::IExperimentationService, Microsoft::VisualStudio::Experimentation::IExperimentationService2, Microsoft::VisualStudio::Experimentation::IExperimentationSetterService, Microsoft::VisualStudio::Experimentation::IExperimentationStatusService
public ref class ExperimentationService sealed : Microsoft::VisualStudio::Telemetry::TelemetryDisposableObject, IDisposable, Microsoft::VisualStudio::Experimentation::IExperimentationService, Microsoft::VisualStudio::Experimentation::IExperimentationService2, Microsoft::VisualStudio::Experimentation::IExperimentationService3, Microsoft::VisualStudio::Experimentation::IExperimentationSetterService, Microsoft::VisualStudio::Experimentation::IExperimentationStatusService
public sealed class ExperimentationService : Microsoft.VisualStudio.Telemetry.TelemetryDisposableObject, IDisposable, Microsoft.VisualStudio.Experimentation.IExperimentationService, Microsoft.VisualStudio.Experimentation.IExperimentationService2, Microsoft.VisualStudio.Experimentation.IExperimentationSetterService, Microsoft.VisualStudio.Experimentation.IExperimentationStatusService
public sealed class ExperimentationService : Microsoft.VisualStudio.Telemetry.TelemetryDisposableObject, IDisposable, Microsoft.VisualStudio.Experimentation.IExperimentationService, Microsoft.VisualStudio.Experimentation.IExperimentationService2, Microsoft.VisualStudio.Experimentation.IExperimentationService3, Microsoft.VisualStudio.Experimentation.IExperimentationSetterService, Microsoft.VisualStudio.Experimentation.IExperimentationStatusService
type ExperimentationService = class
    inherit TelemetryDisposableObject
    interface IExperimentationService
    interface IDisposable
    interface IExperimentationSetterService
    interface IExperimentationStatusService
    interface IExperimentationService2
type ExperimentationService = class
    inherit TelemetryDisposableObject
    interface IExperimentationService
    interface IDisposable
    interface IExperimentationSetterService
    interface IExperimentationStatusService
    interface IExperimentationService2
    interface IExperimentationService3
Public NotInheritable Class ExperimentationService
Inherits TelemetryDisposableObject
Implements IDisposable, IExperimentationService, IExperimentationService2, IExperimentationSetterService, IExperimentationStatusService
Public NotInheritable Class ExperimentationService
Inherits TelemetryDisposableObject
Implements IDisposable, IExperimentationService, IExperimentationService2, IExperimentationService3, IExperimentationSetterService, IExperimentationStatusService
Inheritance
ExperimentationService
Implements

Constructors

ExperimentationService(ExperimentationServiceInitializer)

Construct experimentation service object using initializer object.

Properties

AllEnabledCachedFlights

Gets list of the enabled cached flights.

Default

Gets default experimentation service

DefaultSetter

Gets default setter experimentation service

DefaultStatus

Gets default status experimentation service

IsDisposed

Gets a value indicating whether session is deposed - to detect redundant calls

(Inherited from TelemetryDisposableObject)

Methods

CreateDefaultExperimentationService(ExperimentationServiceInitializer)

Construct an experimentation service object using an initializer obect and set it as the default

Dispose()

This code added to correctly implement the disposable pattern.

(Inherited from TelemetryDisposableObject)
DisposeManagedResources()

User should implement it to dispose managed resources

(Inherited from TelemetryDisposableObject)
GetBoolTreatmentVariableAsync(String, String, CancellationToken)

Returns the value of the Treatment Variable or null if not found. Example: TV: VisualStudio.boolTreatmentVariable: true

GetCachedTreatmentVariables(String)

Get config data for experiments. Fast and cheap method. Read information from the local storage. Can be used on a startup.

GetDoubleTreatmentVariableAsync(String, String, CancellationToken)

Returns the value of the Treatment Variable or null if not found. Example: TV: VisualStudio.numTreatmentVariable: 4.3

GetIntTreatmentVariableAsync(String, String, CancellationToken)

Returns the int value of the Treatment Variable or null if not found or wrong type. Example: TV: VisualStudio.intTreatmentVariable: 42

GetStringTreatmentVariableAsync(String, String, CancellationToken)

Returns the string value of the Treatment Variable or null if not found or wrong type. Example: TV: VisualStudio.stringTreatmentVariable: "foo"

GetTreatmentVariablesAsync(String, CancellationToken)

Get config data for experiments. If request is in the progress wait.

IsCachedFlightEnabled(String)

Get status of the requested flight, if it is enabled for the user + filters. Fast and cheap method. Read information from the local storage. Can be used on a startup. Sends telemetry event to indicate the triggered experimental scenario.

IsFlightEnabledAsync(String, CancellationToken)

Get actual flight status. If requests in the progress waits on them. Sends telemetry event to indicate the triggered experimental scenario.

QueryCachedFlightStatus(String)

Get status of the requested flight, if it is enabled for the user + filters. Fast and cheap method. Does not send a telemetry event to indicate a triggered experimental scenario. Read information from the local storage. Can be used on a startup. IsCachedFlightEnabled should be called at a later point when the experimental scenario will be triggered.

QueryFlightStatusAsync(String, CancellationToken)

Get actual flight status without sending a telemetry event to indicate a triggered experimental scenario. If requests in the progress waits on them. IsFlightEnabledAsync should be called at a later point when the experimental scenario will be triggered.

RequiresNotDisposed()

This function throws an ObjectDisposedException if the object is disposed.

(Inherited from TelemetryDisposableObject)
SetFlight(String, Int32)

Set flight for this machine using flightName as a flight and timeoutInMinutes as an expiration timeout.

Start()

Start the service. Ask all flights providers to start polling there endpoints to get actual flight set.

Applies to