Get-MetricDefinitions
Applies To: Azure PowerShell 1.0
Get-MetricDefinitions
Gets metric definitions.
Syntax
Parameter Set: Default
Get-MetricDefinitions [-ResourceId] <String> [-DetailedOutput] [-MetricNames <String[]> ] [ <CommonParameters>]
Detailed Description
The Get-MetricDefinitions cmdlet gets the definitions of a metric.
Parameters
-DetailedOutput
Indicates that the output is detailed. The default is for summarized output.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-MetricNames<String[]>
Specifies an array of names of metrics. This cmdlet gets definitions for the specified metrics.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-ResourceId<String>
Specifies the ID of the resource with which the metric is associated.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Get summarized definitions of metrics
This command gets summarized definitions for metrics of the given resource.
PS C:\> Get-MetricDefinitions -ResourceId "/subscriptions/d33fb0c7-69d3-40be-e35b-4f0deba70fff/ResourceGroups/Contoso-Web-EastUS/providers/microsoft.web/sites/website2"
OUTPUT:
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
Example 2: Get detailed definitions of metrics
This command gets all the metrics definitions for the specified resource, identified by the resource ID. The results are detailed.
PS C:\> Get-MetricDefinitions -ResourceId "/subscriptions/d33fb0c7-69d3-40be-e35b-4f0deba70fff/ResourceGroups/Contoso-Web-EastUS/providers/microsoft.web/sites/website2" -DetailedOutput
OUTPUT:
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
Example 3: Get metric definitions with filtered output
This command gets two metric definitions for the specified resource. The results are detailed.
PS C:\> Get-MetricDefinitions -ResourceId "/subscriptions/d33fb0c7-69d3-40be-e35b-4f0deba70fff/ResourceGroups/Contoso-Web-EastUS/providers/microsoft.web/sites/website2" -DetailedOutput -MetricNames 'BytesSent','CpuTime'
OUTPUT:
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 : BytesSent
Properties :
PrimaryAggregationType : Total
ResourceUri :
Unit : Bytes