Class: AWSCDK::CloudWatch::CfnAnomalyDetector::DimensionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_watch/cfn_anomaly_detector.rb

Overview

A dimension is a name/value pair that is part of the identity of a metric.

Because dimensions are part of the unique identifier for a metric, whenever you add a unique name/value pair to one of your metrics, you are creating a new variation of that metric. For example, many Amazon EC2 metrics publish InstanceId as a dimension name, and the actual instance ID as the value for that dimension.

You can assign up to 30 dimensions to a metric.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, value:) ⇒ DimensionProperty

Returns a new instance of DimensionProperty.

Parameters:

  • name (String)

    The name of the dimension.

  • value (String)

    The value of the dimension.



653
654
655
656
657
658
# File 'cloud_watch/cfn_anomaly_detector.rb', line 653

def initialize(name:, value:)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @value = value
  Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value")
end

Instance Attribute Details

#nameString (readonly)

The name of the dimension.



664
665
666
# File 'cloud_watch/cfn_anomaly_detector.rb', line 664

def name
  @name
end

#valueString (readonly)

The value of the dimension.

Dimension values must contain only ASCII characters and must include at least one non-whitespace character. ASCII control characters are not supported as part of dimension values.



671
672
673
# File 'cloud_watch/cfn_anomaly_detector.rb', line 671

def value
  @value
end

Class Method Details

.jsii_propertiesObject



673
674
675
676
677
678
# File 'cloud_watch/cfn_anomaly_detector.rb', line 673

def self.jsii_properties
  {
    :name => "name",
    :value => "value",
  }
end

Instance Method Details

#to_jsiiObject



680
681
682
683
684
685
686
687
# File 'cloud_watch/cfn_anomaly_detector.rb', line 680

def to_jsii
  result = {}
  result.merge!({
    "name" => @name,
    "value" => @value,
  })
  result.compact
end