Get-AzureWebHostingPlanMetric
Gets metrics for Azure website hosting plans.
Note
The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.
The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.
Syntax
Default (Default)
Get-AzureWebHostingPlanMetric
[-MetricNames <String[]>]
[-StartDate <DateTime>]
[-EndDate <DateTime>]
[-TimeGrain <String>]
[-InstanceDetails]
[-WebSpaceName <String>]
[-Name <String>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Description
This topic describes the cmdlet in the 0.8.10 version of the Microsoft Azure PowerShell module.
To get the version of the module you're using, in the Azure PowerShell console, type (Get-Module -Name Azure).Version
.
The Get-AzureWebHostingPlanMetric cmdlet gets metrics for Azure web hosting plans in a subscription.
Examples
Example 1: Get metrics for the last three hours at a per-instance level
PS C:\> Get-AzureWebHostingPlanMetric -WebSpaceName "eastuswebspace" -StartDate (get-date).AddHours(-3) -InstanceDetails $Metrics[1].Data
Name : CpuPercentage
Unit : Percent
StartTime : 8/11/2014 7:00:00 AM
EndTime : 8/11/2014 5:00:23 PM
TimeGrain : PT1H
PrimaryAggregationType : Instance
Values : {Time:8/11/2014 7:00:00 AM, Total:2, Min:9, Max:0, Time:8/11/2014 8:00:00 AM, Total:2, Min:9, Max:0,
Time:8/11/2014 9:00:00 AM, Total:2, Min:9, Max:0, Time:8/11/2014 10:00:00 AM, Total:2, Min:8, Max:0...} $metrics[1].Data.Values | ft
TimeCreated Total Minimum Maximum Count InstanceName
----------- ----- ------- ------- ----- ------------
8/11/2014 7:00:00 AM 2 9 0 1 RD00155DC24599
8/11/2014 8:00:00 AM 2 9 0 1 RD00155DC24599
8/11/2014 9:00:00 AM 2 9 0 1 RD00155DC24579
8/11/2014 10:00:00 AM 2 8 0 1 RD00155DC24599
8/11/2014 11:00:00 AM 2 9 0 1 RD00155DC24599
8/11/2014 12:00:00 PM 2 6 0 1 RD00155DC24599
8/11/2014 1:00:00 PM 2 15 0 1 RD00155DC24599
8/11/2014 2:00:00 PM 3 21 0 1 RD00155DC24599
8/11/2014 3:00:00 PM 2 13 0 1 RD00155DC24599
8/11/2014 4:00:00 PM 2 14 0 1 RD00155DC24599
This command gets web hosting plan metrics for last three hours on per-instance level.
Parameters
-EndDate
Specifies the end time, as a DateTime object, from which to return metrics.
To obtain a DateTime object, use the Get-Date cmdlet.
For more information, type Get-Help Get-Date
.
Parameter properties
Type: | DateTime |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-InstanceDetails
Indicates that this cmdlet includes details on a per-instance level. If the website hosting plan runs on two or more machines, this cmdlet returns details metrics for each machine.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-MetricNames
Species an array of metrics to get. If you do not specify a value for this parameter, this cmdlet gets all metrics.
Parameter properties
Type: | String[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-Name
Specifies the name of a plan in the subscription. By default, Get-AzureWebHostingPlanMetric gets all websites in the current subscription. This parameter does not support wildcard characters.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-Profile
Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.
Parameter properties
Type: | AzureSMProfile |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-StartDate
Specifies the start time, as a DateTime object, for which to get metrics.
Parameter properties
Type: | DateTime |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-TimeGrain
Specifies the time unit for which to get metrics. Valid values are:
- PT1M (Minute)
- PT1H (Hour)
- P1D (Day)
The default value is PT1H.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-WebSpaceName
Specifies the name of a webspace in the subscription. By default, Get-AzureWebHostingPlanMetric gets all plans in the current subscription. This parameter does not support wildcard characters.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | WebSpace |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
undefined
You can pass input to this cmdlet by property name, but not by value.
Outputs
undefined
Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities.MetricResponse
By default, Get-AzureWebHostingPlanMetric returns an array of MetricResponse objects.