你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzAutoscaleHistory
获取自动缩放历史记录。
语法
Get-AzAutoscaleHistory
[-ResourceId <String>]
[-StartTime <DateTime>]
[-EndTime <DateTime>]
[-Status <String>]
[-Caller <String>]
[-DetailedOutput]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzAutoscaleHistory cmdlet 获取与自动缩放设置相关的事件历史记录。
示例
示例 1:获取与订阅关联的所有事件
Get-AzAutoscaleHistory -StartTime 2015-02-09T18:35:00 -EndTime 2015-02-09T18:40:00 -DetailedOutput
此命令获取与当前订阅关联的所有自动缩放相关事件。
示例 2:特定资源的 GetAutoscaleHistory
Get-AzAutoscaleHistory -StartTime 2015-02-09T18:35:00 -EndTime 2015-02-09T18:40:00 -ResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/Microsoft.Insights/autoscalesettings/DefaultServerFarm-Default-Web-EastUS" -DetailedOutput
Authorization :
Caller : Microsoft.Insights/autoscaleSettings
Claims : http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn: Microsoft.Insights/autoscaleSettings
CorrelationId : 00001111-aaaa-2222-bbbb-3333cccc4444
Description : The autoscale engine attempting to scale resource '/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deb
a10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/serverFarms/DefaultServerFarm'
from 1 instances count to 2 instances count.
EventDataId : c554f7ed-514c-449c-9338-13e15b4b56a3
EventName : AutoscaleAction
EventSource : Microsoft.Insights/autoscalesettings
EventTimestamp : 2/10/2015 2:38:19 AM
HttpRequest :
Id : /subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/
Microsoft.Insights/autoscalesettings/DefaultServerFarm-Default-Web-EastUS/events/c554f7ed-514c-4
49c-9338-13e15b4b56a3/ticks/635591326997519815
Level : Informational
OperationId : 00001111-aaaa-2222-bbbb-3333cccc4444
OperationName : ScaleUp
Properties :
Description : The autoscale engine attempting to scale resource '/subscriptions/a93fb07c-6c93
-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/serverFarms/De
faultServerFarm' from 1 instances count to 2 instances count.
ResourceName : /subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-
EastUS/providers/microsoft.web/serverFarms/DefaultServerFarm
OldInstancesCount: 1
NewInstancesCount: 2
ActiveAutoscaleProfile: {
"Name": "No scheduled times",
"Capacity": {
"Minimum": "1",
"Maximum": "3",
"Default": "1"
},
"Rules": [
{
"MetricTrigger": {
"Name": "CpuPercentage",
"Namespace": "",
"Resource": "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-
Web-EastUS/providers/microsoft.web/serverFarms/DefaultServerFarm",
"ResourceLocation": "East US",
"TimeGrain": "PT1M",
"Statistic": "Average",
"TimeWindow": "PT45M",
"TimeAggregation": "Average",
"Operator": "GreaterThanOrEqual",
"Threshold": 14.0,
"Source": "WebsiteDedicated:eastuswebspace:DefaultServerFarm"
},
"ScaleAction": {
"Direction": "Increase",
"Type": "ChangeCount",
"Value": "1",
"Cooldown": "PT5M"
}
},
{
"MetricTrigger": {
"Name": "CpuPercentage",
"Namespace": "",
"Resource": "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-
Web-EastUS/providers/microsoft.web/serverFarms/DefaultServerFarm",
"ResourceLocation": "East US",
"TimeGrain": "PT1M",
"Statistic": "Average",
"TimeWindow": "PT45M",
"TimeAggregation": "Average",
"Operator": "LessThanOrEqual",
"Threshold": 4.0,
"Source": "WebsiteDedicated:eastuswebspace:DefaultServerFarm"
},
"ScaleAction": {
"Direction": "Decrease",
"Type": "ChangeCount",
"Value": "1",
"Cooldown": "PT2H"
}
},
{
"MetricTrigger": {
"Name": "BytesReceived",
"Namespace": "",
"Resource": "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-
Web-EastUS/providers/microsoft.web/serverFarms/DefaultServerFarm",
"ResourceLocation": "East US",
"TimeGrain": "PT1M",
"Statistic": "Average",
"TimeWindow": "PT10M",
"TimeAggregation": "Average",
"Operator": "LessThanOrEqual",
"Threshold": 50.0,
"Source": "WebsiteDedicated:eastuswebspace:DefaultServerFarm"
},
"ScaleAction": {
"Direction": "Decrease",
"Type": "ChangeCount",
"Value": "1",
"Cooldown": "PT10M"
}
},
{
"MetricTrigger": {
"Name": "BytesReceived",
"Namespace": "",
"Resource": "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-
Web-EastUS/providers/microsoft.web/serverFarms/DefaultServerFarm",
"ResourceLocation": "East US",
"TimeGrain": "PT1M",
"Statistic": "Average",
"TimeWindow": "PT5M",
"TimeAggregation": "Average",
"Operator": "GreaterThanOrEqual",
"Threshold": 100.0,
"Source": "WebsiteDedicated:eastuswebspace:DefaultServerFarm"
},
"ScaleAction": {
"Direction": "Increase",
"Type": "ChangeCount",
"Value": "1",
"Cooldown": "PT10M"
}
}
]
}
ResourceGroupName : Default-Web-EastUS
ResourceProviderName : Microsoft.Insights
ResourceId : /subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/
Microsoft.Insights/autoscalesettings/DefaultServerFarm-Default-Web-EastUS
Status : Succeeded
SubmissionTimestamp : 2/10/2015 2:38:19 AM
SubscriptionId : b93fb07a-6f93-30be-bf3e-4f0deca15f4f
SubStatus :
此命令获取与资源 ID(实质上为 ResourceUri)标识的特定资源关联的所有自动缩放相关事件。
参数
-Caller
指定调用方。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 azure 通信的凭据、帐户、租户和订阅
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DetailedOutput
指示此操作包含详细的输出。 如果未指定此参数,则会汇总输出。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-EndTime
指定本地时间查询的结束时间。 默认值为当前时间。
类型: | Nullable<T>[DateTime] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-ResourceId
指定自动缩放设置关联到的资源 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-StartTime
指定本地时间查询的开始时间。 此参数是可选的。 默认值为当前本地时间减去一小时。
类型: | Nullable<T>[DateTime] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Status
按状态指定筛选器。 此参数是可选的。 错误是空字符串(即无筛选器)
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
输入
Nullable<T>[[System.DateTime, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]