Class CfnExperiment

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-11T15:55:59.293Z") @Stability(Stable) public class CfnExperiment extends CfnResource implements IInspectable, ITaggable
Creates or updates an Evidently experiment .

Before you create an experiment, you must create the feature to use for the experiment.

An experiment helps you make feature design decisions based on evidence and data. An experiment can test as many as five variations at once. Evidently collects experiment data and analyzes it by statistical methods, and provides clear recommendations about which variations perform better.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.evidently.*;
 CfnExperiment cfnExperiment = CfnExperiment.Builder.create(this, "MyCfnExperiment")
         .metricGoals(List.of(MetricGoalObjectProperty.builder()
                 .desiredChange("desiredChange")
                 .entityIdKey("entityIdKey")
                 .metricName("metricName")
                 .valueKey("valueKey")
                 // the properties below are optional
                 .eventPattern("eventPattern")
                 .unitLabel("unitLabel")
                 .build()))
         .name("name")
         .onlineAbConfig(OnlineAbConfigObjectProperty.builder()
                 .controlTreatmentName("controlTreatmentName")
                 .treatmentWeights(List.of(TreatmentToWeightProperty.builder()
                         .splitWeight(123)
                         .treatment("treatment")
                         .build()))
                 .build())
         .project("project")
         .treatments(List.of(TreatmentObjectProperty.builder()
                 .feature("feature")
                 .treatmentName("treatmentName")
                 .variation("variation")
                 // the properties below are optional
                 .description("description")
                 .build()))
         // the properties below are optional
         .description("description")
         .randomizationSalt("randomizationSalt")
         .removeSegment(false)
         .runningStatus(RunningStatusObjectProperty.builder()
                 .status("status")
                 // the properties below are optional
                 .analysisCompleteTime("analysisCompleteTime")
                 .desiredState("desiredState")
                 .reason("reason")
                 .build())
         .samplingRate(123)
         .segment("segment")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnExperiment

      protected CfnExperiment(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnExperiment

      protected CfnExperiment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnExperiment

      @Stability(Stable) public CfnExperiment(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnExperimentProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The ARN of the experiment.

      For example, arn:aws:evidently:us-west-2:0123455678912:project/myProject/experiment/myExperiment

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getMetricGoals

      @Stability(Stable) @NotNull public Object getMetricGoals()
      An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.
    • setMetricGoals

      @Stability(Stable) public void setMetricGoals(@NotNull IResolvable value)
      An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.
    • setMetricGoals

      @Stability(Stable) public void setMetricGoals(@NotNull List<Object> value)
      An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.
    • getName

      @Stability(Stable) @NotNull public String getName()
      A name for the new experiment.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      A name for the new experiment.
    • getOnlineAbConfig

      @Stability(Stable) @NotNull public Object getOnlineAbConfig()
      A structure that contains the configuration of which variation to use as the "control" version.
    • setOnlineAbConfig

      @Stability(Stable) public void setOnlineAbConfig(@NotNull IResolvable value)
      A structure that contains the configuration of which variation to use as the "control" version.
    • setOnlineAbConfig

      @Stability(Stable) public void setOnlineAbConfig(@NotNull CfnExperiment.OnlineAbConfigObjectProperty value)
      A structure that contains the configuration of which variation to use as the "control" version.
    • getProject

      @Stability(Stable) @NotNull public String getProject()
      The name or the ARN of the project where this experiment is to be created.
    • setProject

      @Stability(Stable) public void setProject(@NotNull String value)
      The name or the ARN of the project where this experiment is to be created.
    • getTreatments

      @Stability(Stable) @NotNull public Object getTreatments()
      An array of structures that describe the configuration of each feature variation used in the experiment.
    • setTreatments

      @Stability(Stable) public void setTreatments(@NotNull IResolvable value)
      An array of structures that describe the configuration of each feature variation used in the experiment.
    • setTreatments

      @Stability(Stable) public void setTreatments(@NotNull List<Object> value)
      An array of structures that describe the configuration of each feature variation used in the experiment.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      An optional description of the experiment.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      An optional description of the experiment.
    • getRandomizationSalt

      @Stability(Stable) @Nullable public String getRandomizationSalt()
      When Evidently assigns a particular user session to an experiment, it must use a randomization ID to determine which variation the user session is served.
    • setRandomizationSalt

      @Stability(Stable) public void setRandomizationSalt(@Nullable String value)
      When Evidently assigns a particular user session to an experiment, it must use a randomization ID to determine which variation the user session is served.
    • getRemoveSegment

      @Stability(Stable) @Nullable public Object getRemoveSegment()
      Set this to true to remove the segment that is associated with this experiment.
    • setRemoveSegment

      @Stability(Stable) public void setRemoveSegment(@Nullable Boolean value)
      Set this to true to remove the segment that is associated with this experiment.
    • setRemoveSegment

      @Stability(Stable) public void setRemoveSegment(@Nullable IResolvable value)
      Set this to true to remove the segment that is associated with this experiment.
    • getRunningStatus

      @Stability(Stable) @Nullable public Object getRunningStatus()
      A structure that you can use to start and stop the experiment.
    • setRunningStatus

      @Stability(Stable) public void setRunningStatus(@Nullable IResolvable value)
      A structure that you can use to start and stop the experiment.
    • setRunningStatus

      @Stability(Stable) public void setRunningStatus(@Nullable CfnExperiment.RunningStatusObjectProperty value)
      A structure that you can use to start and stop the experiment.
    • getSamplingRate

      @Stability(Stable) @Nullable public Number getSamplingRate()
      The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent.
    • setSamplingRate

      @Stability(Stable) public void setSamplingRate(@Nullable Number value)
      The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent.
    • getSegment

      @Stability(Stable) @Nullable public String getSegment()
      Specifies an audience segment to use in the experiment.
    • setSegment

      @Stability(Stable) public void setSegment(@Nullable String value)
      Specifies an audience segment to use in the experiment.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      Assigns one or more tags (key-value pairs) to the experiment.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      Assigns one or more tags (key-value pairs) to the experiment.