Get-AzMetricDefinition
获取指标定义。
语法
Default (默认值)
Get-AzMetricDefinition
[-ResourceId] <String>
[-MetricName <String[]>]
[-MetricNamespace <String>]
[-DetailedOutput]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzMetricDefinition cmdlet 获取指标定义。
示例
示例 1:获取资源的指标定义
Get-AzMetricDefinition -ResourceId "/subscriptions/d33fb0c7-69d3-40be-e35b-4f0deba70fff/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/website2"
Name : CpuTime
Dimensions : {}
MetricAvailabilities : {Microsoft.Azure.Insights.Models.MetricAvailability,
Microsoft.Azure.Insights.Models.MetricAvailability,
Microsoft.Azure.Insights.Models.MetricAvailability}
PrimaryAggregationType : Total
Properties : {}
ResourceUri :
Unit : Seconds
Name : Requests
Dimensions : {}
MetricAvailabilities : {Microsoft.Azure.Insights.Models.MetricAvailability,
Microsoft.Azure.Insights.Models.MetricAvailability,
Microsoft.Azure.Insights.Models.MetricAvailability}
PrimaryAggregationType : Total
Properties : {}
ResourceUri :
Unit : Count
此命令获取指定资源的指标定义。
示例 2:获取包含详细输出的指标定义
Get-AzMetricDefinition -ResourceId "/subscriptions/d33fb0c7-69d3-40be-e35b-4f0deba70fff/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/website2" -DetailedOutput
Dimensions :
MetricAvailabilities :
Location :
Retention : 2.00:00:00
Values : 00:01:00
Location :
Retention : 30.00:00:00
Values : 01:00:00
Location :
Retention : 90.00:00:00
Values : 1.00:00:00
Name : CpuTime
Properties :
PrimaryAggregationType : Total
ResourceUri :
Unit : Seconds
Dimensions :
MetricAvailabilities :
Location :
Retention : 2.00:00:00
Values : 00:01:00
Location :
Retention : 30.00:00:00
Values : 01:00:00
Location :
Retention : 90.00:00:00
Values : 1.00:00:00
Name : Requests
Properties :
PrimaryAggregationType : Total
ResourceUri :
Unit : Count
此命令获取 website2 的指标定义。 输出是详细的。
示例 3:按名称获取指标定义
Get-AzMetricDefinition -ResourceId "/subscriptions/d33fb0c7-69d3-40be-e35b-4f0deba70fff/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/website2" -DetailedOutput -MetricName "BytesSent,CpuTime"
MetricAvailabilities :
Location :
Retention : 2.00:00:00
Values : 00:01:00
Location :
Retention : 30.00:00:00
Values : 01:00:00
Location :
Retention : 90.00:00:00
Values : 1.00:00:00
Name : CpuTime
Properties :
PrimaryAggregationType : Total
ResourceUri :
Unit : Seconds
Dimensions :
MetricAvailabilities :
Location :
Retention : 2.00:00:00
Values : 00:01:00
Location :
Retention : 30.00:00:00
Values : 01:00:00
Location :
Retention : 90.00:00:00
Values : 1.00:00:00
Name : BytesSent
Properties :
PrimaryAggregationType : Total
ResourceUri :
Unit : Bytes
此命令获取 BytesSent 和 CpuTime 指标的定义。 输出是详细的。
参数
-DefaultProfile
用于与 azure 通信的凭据、帐户、租户和订阅
参数属性
类型: | IAzureContextContainer |
默认值: | None |
支持通配符: | False |
不显示: | False |
别名: | AzContext, AzureRmContext, AzureCredential |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-DetailedOutput
指示此操作包含详细的输出。 如果未指定此参数,则会汇总输出。
参数属性
类型: | SwitchParameter |
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-MetricName
指定指标名称的数组。
参数属性
类型: | String[] |
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-MetricNamespace
指定要查询其指标定义的指标命名空间。
参数属性
类型: | String |
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-ResourceId
指定资源 ID。
参数属性
类型: | String |
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | 0 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。