Class: AWSCDK::IoTSiteWise::CfnAssetModel::MetricProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
io_t_site_wise/cfn_asset_model.rb

Overview

Contains an asset metric property.

With metrics, you can calculate aggregate functions, such as an average, maximum, or minimum, as specified through an expression. A metric maps several values to a single value (such as a sum).

The maximum number of dependent/cascading variables used in any one metric calculation is 10. Therefore, a root metric can have up to 10 cascading metrics in its computational dependency tree. Additionally, a metric can only have a data type of DOUBLE and consume properties with data types of INTEGER or DOUBLE .

For more information, see Metrics in the AWS IoT SiteWise User Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expression:, variables:, window:) ⇒ MetricProperty

Returns a new instance of MetricProperty.

Parameters:



1177
1178
1179
1180
1181
1182
1183
1184
# File 'io_t_site_wise/cfn_asset_model.rb', line 1177

def initialize(expression:, variables:, window:)
  @expression = expression
  Jsii::Type.check_type(@expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "expression")
  @variables = variables
  Jsii::Type.check_type(@variables, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaW90c2l0ZXdpc2UuQ2ZuQXNzZXRNb2RlbC5FeHByZXNzaW9uVmFyaWFibGVQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "variables")
  @window = window.is_a?(Hash) ? ::AWSCDK::IoTSiteWise::CfnAssetModel::MetricWindowProperty.new(**window.transform_keys(&:to_sym)) : window
  Jsii::Type.check_type(@window, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pb3RzaXRld2lzZS5DZm5Bc3NldE1vZGVsLk1ldHJpY1dpbmRvd1Byb3BlcnR5In1dfX0=")), "window")
end

Instance Attribute Details

#expressionString (readonly)

The mathematical expression that defines the metric aggregation function.

You can specify up to 10 variables per expression. You can specify up to 10 functions per expression.

For more information, see Quotas in the AWS IoT SiteWise User Guide .



1194
1195
1196
# File 'io_t_site_wise/cfn_asset_model.rb', line 1194

def expression
  @expression
end

#windowAWSCDK::IResolvable, AWSCDK::IoTSiteWise::CfnAssetModel::MetricWindowProperty (readonly)

The window (time interval) over which AWS IoT SiteWise computes the metric's aggregation expression.

AWS IoT SiteWise computes one data point per window .



1206
1207
1208
# File 'io_t_site_wise/cfn_asset_model.rb', line 1206

def window
  @window
end

Class Method Details

.jsii_propertiesObject



1208
1209
1210
1211
1212
1213
1214
# File 'io_t_site_wise/cfn_asset_model.rb', line 1208

def self.jsii_properties
  {
    :expression => "expression",
    :variables => "variables",
    :window => "window",
  }
end

Instance Method Details

#to_jsiiObject



1216
1217
1218
1219
1220
1221
1222
1223
1224
# File 'io_t_site_wise/cfn_asset_model.rb', line 1216

def to_jsii
  result = {}
  result.merge!({
    "expression" => @expression,
    "variables" => @variables,
    "window" => @window,
  })
  result.compact
end