共用方式為


Get-AzureWebHostingPlanMetric

取得 Azure 網站主控方案的計量。

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (ARM) 資源的建議 PowerShell 模組。

語法

Get-AzureWebHostingPlanMetric
   [-MetricNames <String[]>]
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   [-TimeGrain <String>]
   [-InstanceDetails]
   [-WebSpaceName <String>]
   [-Name <String>]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

本主題描述 Microsoft Azure PowerShell 模組 0.8.10 版本中的 Cmdlet。 若要取得您所使用的模組版本,請在 Azure PowerShell 控制台中輸入 (Get-Module -Name Azure).Version

Get-AzureWebHostingPlanMetric Cmdlet 會取得訂用帳戶中 Azure Web 主控方案的計量。

範例

範例 1:取得每個實例層級過去三個小時的計量

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

此命令會取得每個實例層級過去三個小時的 Web 主控方案計量。

參數

-EndDate

將結束時間指定為 DateTime 物件,以便從中傳回計量。 若要取得 DateTime 物件,請使用 Get-Date Cmdlet。 如需詳細資訊,請輸入 Get-Help Get-Date

類型:DateTime
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-InstanceDetails

指出此 Cmdlet 包含每個實例層級的詳細數據。 如果網站主控方案在兩部以上的計算機上執行,此 Cmdlet 會傳回每部計算機的詳細數據計量。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-MetricNames

物種要取得的計量陣列。 如果您未指定此參數的值,此 Cmdlet 會取得所有計量。

類型:String[]
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-Name

指定訂用帳戶中的方案名稱。 根據預設, Get-AzureWebHostingPlanMetric 會取得目前訂用帳戶中的所有網站。 此參數不支援通配符。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-Profile

指定此 Cmdlet 從中讀取的 Azure 設定檔。 如果您未指定設定檔,此 Cmdlet 會從本機預設配置檔讀取。

類型:AzureSMProfile
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-StartDate

將開始時間指定為 DateTime 物件,以取得計量。

類型:DateTime
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-TimeGrain

指定要取得計量的時間單位。 有效值為:

  • PT1M (分鐘)
  • PT1H (小時)
  • P1D (日)

預設值為 PT1H。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-WebSpaceName

指定訂用帳戶中的 Webspace 名稱。 根據預設, Get-AzureWebHostingPlanMetric 會取得目前訂用帳戶中的所有方案。 此參數不支援通配符。

類型:String
別名:WebSpace
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

輸入

您可以依屬性名稱將輸入傳遞至此 Cmdlet,但不能依值傳遞。

輸出

Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities.MetricResponse

根據預設,Get-AzureWebHostingPlanMetric 會傳回 MetricResponse 對象的陣列