【发布时间】:2019-04-09 15:38:02
【问题描述】:
我在获取 EBS 卷的 IOP 统计信息时遇到了一些问题,使用以下代码:
Get-CWMetricList -Namespace AWS/EC2 |Select-Object * -Unique
Get-CWMetricList -Namespace AWS/EBS |Select-Object * -Unique
$StartDate = (Get-Date).AddDays(-3)
$EndDate = Get-Date
$ReadIOPS = Get-CWMetricStatistics -Namespace "AWS/EC2" -MetricName "DiskReadOps" -UtcStartTime $StartDate -UtcEndTime $EndDate -Period 300 -Statistics @("Average")
$ReadIOPS.Datapoints.Count
$ReadIOPS = Get-CWMetricStatistics -Namespace "AWS/EBS" -MetricName "VolumeReadOps" -UTCStartTime $StartDate -UTCEndTime $EndDate -Period 300 -Statistics @("Average")
$ReadIOPS.Datapoints.Count
前 2 行显示命名空间/指标名称是正确的。 Rest 应该显示 AWS/EC2 命名空间中的第一个查询获取数据,但 AWS/EBS 命名空间中的第二个查询没有。
最终目标是添加一个 -dimension 标签并获取特定卷的所有读/写 iops。这就是 AWS/EC2 命名空间不起作用的原因,因为我需要指定卷 ID 而不是实例 ID。
任何想法为什么我没有在后一个查询中获取任何数据点?
【问题讨论】:
标签: amazon-web-services powershell aws-powershell