Class: AWSCDK::IoTSiteWise::CfnAssetModel::TumblingWindowProperty

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

Overview

Contains a tumbling window, which is a repeating fixed-sized, non-overlapping, and contiguous time window.

You can use this window in metrics to aggregate data from properties and other assets.

You can use m , h , d , and w when you specify an interval or offset. Note that m represents minutes, h represents hours, d represents days, and w represents weeks. You can also use s to represent seconds in offset .

The interval and offset parameters support the ISO 8601 format . For example, PT5S represents 5 seconds, PT5M represents 5 minutes, and PT5H represents 5 hours.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(interval:, offset: nil) ⇒ TumblingWindowProperty

Returns a new instance of TumblingWindowProperty.

Parameters:

  • interval (String)

    The time interval for the tumbling window. The interval time must be between 1 minute and 1 week.

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

    The offset for the tumbling window. The offset parameter accepts the following:.



1427
1428
1429
1430
1431
1432
# File 'io_t_site_wise/cfn_asset_model.rb', line 1427

def initialize(interval:, offset: nil)
  @interval = interval
  Jsii::Type.check_type(@interval, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "interval")
  @offset = offset
  Jsii::Type.check_type(@offset, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "offset") unless @offset.nil?
end

Instance Attribute Details

#intervalString (readonly)

The time interval for the tumbling window. The interval time must be between 1 minute and 1 week.

AWS IoT SiteWise computes the 1w interval the end of Sunday at midnight each week (UTC), the 1d interval at the end of each day at midnight (UTC), the 1h interval at the end of each hour, and so on.

When AWS IoT SiteWise aggregates data points for metric computations, the start of each interval is exclusive and the end of each interval is inclusive. AWS IoT SiteWise places the computed data point at the end of the interval.



1442
1443
1444
# File 'io_t_site_wise/cfn_asset_model.rb', line 1442

def interval
  @interval
end

#offsetString? (readonly)

The offset for the tumbling window. The offset parameter accepts the following:.

  • The offset time.

For example, if you specify 18h for offset and 1d for interval , AWS IoT SiteWise aggregates data in one of the following ways:

  • If you create the metric before or at 6 PM (UTC), you get the first aggregation result at 6 PM (UTC) on the day when you create the metric.
  • If you create the metric after 6 PM (UTC), you get the first aggregation result at 6 PM (UTC) the next day.
  • The ISO 8601 format.

For example, if you specify PT18H for offset and 1d for interval , AWS IoT SiteWise aggregates data in one of the following ways:

  • If you create the metric before or at 6 PM (UTC), you get the first aggregation result at 6 PM (UTC) on the day when you create the metric.
  • If you create the metric after 6 PM (UTC), you get the first aggregation result at 6 PM (UTC) the next day.
  • The 24-hour clock.

For example, if you specify 00:03:00 for offset , 5m for interval , and you create the metric at 2 PM (UTC), you get the first aggregation result at 2:03 PM (UTC). You get the second aggregation result at 2:08 PM (UTC).

  • The offset time zone.

For example, if you specify 2021-07-23T18:00-08 for offset and 1d for interval , AWS IoT SiteWise aggregates data in one of the following ways:

  • If you create the metric before or at 6 PM (PST), you get the first aggregation result at 6 PM (PST) on the day when you create the metric.
  • If you create the metric after 6 PM (PST), you get the first aggregation result at 6 PM (PST) the next day.


1470
1471
1472
# File 'io_t_site_wise/cfn_asset_model.rb', line 1470

def offset
  @offset
end

Class Method Details

.jsii_propertiesObject



1472
1473
1474
1475
1476
1477
# File 'io_t_site_wise/cfn_asset_model.rb', line 1472

def self.jsii_properties
  {
    :interval => "interval",
    :offset => "offset",
  }
end

Instance Method Details

#to_jsiiObject



1479
1480
1481
1482
1483
1484
1485
1486
# File 'io_t_site_wise/cfn_asset_model.rb', line 1479

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