Class: AWSCDK::Evidently::CfnLaunch::MetricDefinitionObjectProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
evidently/cfn_launch.rb

Overview

This structure defines a metric that you want to use to evaluate the variations during a launch or experiment.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entity_id_key:, metric_name:, value_key:, event_pattern: nil, unit_label: nil) ⇒ MetricDefinitionObjectProperty

Returns a new instance of MetricDefinitionObjectProperty.

Parameters:

  • entity_id_key (String)

    The entity, such as a user or session, that does an action that causes a metric value to be recorded.

  • metric_name (String)

    A name for the metric.

  • value_key (String)

    The value that is tracked to produce the metric.

  • event_pattern (String, nil) (defaults to: nil)

    The EventBridge event pattern that defines how the metric is recorded.

  • unit_label (String, nil) (defaults to: nil)

    A label for the units that the metric is measuring.



803
804
805
806
807
808
809
810
811
812
813
814
# File 'evidently/cfn_launch.rb', line 803

def initialize(entity_id_key:, metric_name:, value_key:, event_pattern: nil, unit_label: nil)
  @entity_id_key = entity_id_key
  Jsii::Type.check_type(@entity_id_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "entityIdKey")
  @metric_name = metric_name
  Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  @value_key = value_key
  Jsii::Type.check_type(@value_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "valueKey")
  @event_pattern = event_pattern
  Jsii::Type.check_type(@event_pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "eventPattern") unless @event_pattern.nil?
  @unit_label = unit_label
  Jsii::Type.check_type(@unit_label, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "unitLabel") unless @unit_label.nil?
end

Instance Attribute Details

#entity_id_keyString (readonly)

The entity, such as a user or session, that does an action that causes a metric value to be recorded.

An example is userDetails.userID .



822
823
824
# File 'evidently/cfn_launch.rb', line 822

def entity_id_key
  @entity_id_key
end

#event_patternString? (readonly)

The EventBridge event pattern that defines how the metric is recorded.

For more information about EventBridge event patterns, see Amazon EventBridge event patterns .



841
842
843
# File 'evidently/cfn_launch.rb', line 841

def event_pattern
  @event_pattern
end

#metric_nameString (readonly)

A name for the metric.

It can include up to 255 characters.



829
830
831
# File 'evidently/cfn_launch.rb', line 829

def metric_name
  @metric_name
end

#unit_labelString? (readonly)

A label for the units that the metric is measuring.



846
847
848
# File 'evidently/cfn_launch.rb', line 846

def unit_label
  @unit_label
end

#value_keyString (readonly)

The value that is tracked to produce the metric.



834
835
836
# File 'evidently/cfn_launch.rb', line 834

def value_key
  @value_key
end

Class Method Details

.jsii_propertiesObject



848
849
850
851
852
853
854
855
856
# File 'evidently/cfn_launch.rb', line 848

def self.jsii_properties
  {
    :entity_id_key => "entityIdKey",
    :metric_name => "metricName",
    :value_key => "valueKey",
    :event_pattern => "eventPattern",
    :unit_label => "unitLabel",
  }
end

Instance Method Details

#to_jsiiObject



858
859
860
861
862
863
864
865
866
867
868
# File 'evidently/cfn_launch.rb', line 858

def to_jsii
  result = {}
  result.merge!({
    "entityIdKey" => @entity_id_key,
    "metricName" => @metric_name,
    "valueKey" => @value_key,
    "eventPattern" => @event_pattern,
    "unitLabel" => @unit_label,
  })
  result.compact
end