Get-​Azure​Batch​Pool​Usage​Metrics

Gets pool usage metrics for a Batch account.

Syntax

Get-AzureBatchPoolUsageMetrics
   -BatchContext <BatchAccountContext>
   [-EndTime <DateTime>]
   [-Filter <String>]
   [-StartTime <DateTime>]
   [<CommonParameters>]

Description

The Get-AzureBatchPoolUsageMetrics cmdlet gets the usage metrics, aggregated by pool across individual time intervals, for the specified account. You can get the statistics for a specific pool and for a time range.

Examples

Example 1: Get pool usage metrics for a time range

PS C:\>$Context = Get-AzureRmBatchAccountKeys -AccountName "ContosoBatchAccount"
PS C:\> $StartTime = Get-Date -Date "2016-05-16 00:00:00Z"
PS C:\> $EndTime = Get-Date -Date "2016-05-16 01:00:00Z"
PS C:\> Get-AzureBatchPoolUsageMetrics -StartTime $StartTime -EndTime $EndTime -BatchContext $context
DataEgressGiB      : 6.68875873088837E-06
DataIngressGiB     : 1.9485130906105E-05
EndTime            : 5/16/2016 12:30:00 AM
PoolId             : testpool1
StartTime          : 5/16/2016 12:00:00 AM
TotalCoreHours     : 8
VirtualMachineSize : standard_d4

DataEgressGiB      : 5.61587512493134E-06
DataIngressGiB     : 1.76150351762772E-05
EndTime            : 5/16/2016 12:30:00 AM
PoolId             : testpool2
StartTime          : 5/16/2016 12:00:00 AM
TotalCoreHours     : 12
VirtualMachineSize : standard_d4

DataEgressGiB      : 7.36676156520844E-06
DataIngressGiB     : 2.10804864764214E-05
EndTime            : 5/16/2016 1:00:00 AM
PoolId             : testpool1
StartTime          : 5/16/2016 12:30:00 AM
TotalCoreHours     : 7.99999999955555
VirtualMachineSize : standard_d4

DataEgressGiB      : 5.80586493015289E-06
DataIngressGiB     : 1.80602073669434E-05
EndTime            : 5/16/2016 1:00:00 AM
PoolId             : testpool2
StartTime          : 5/16/2016 12:30:00 AM
TotalCoreHours     : 11.9999999993333
VirtualMachineSize : standard_d4

The first command creates an object reference to the account keys for the batch account named ContosoBatchAccount by using Get-AzureRmBatchAccountKeys. The command stores this object reference in the $Context variable.

The next two commands create DateTime objects by using the Get-Date cmdlet. The commands store these values in the $StartTime and $EndTime variables for use with the final command.

The final command returns all of the pool usage metrics, aggregated by pool, across time interval between the specified start and end times.

Example 2: Get pool usage metrics by using a filter

PS C:\>Get-AzureBatchPoolUsageMetrics -Filter "poolId eq 'ContosoPool'" -BatchContext $Context
DataEgressGiB      : 9.0496614575386E-06
DataIngressGiB     : 2.60043889284134E-05
EndTime            : 5/16/2016 5:30:00 PM
PoolId             : MyPool
StartTime          : 5/16/2016 5:00:00 PM
TotalCoreHours     : 12
VirtualMachineSize : standard_d4

This command returns the usage metrics for pool named ContosoPool. The command specifies a filter string to specify that pool, and uses the same $Context value as the previous example.

Required Parameters

-BatchContext

Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. To obtain a BatchAccountContext object that contains access keys for your subscription, use the Get-AzureRmBatchAccountKeys cmdlet.

Type:BatchAccountContext
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-EndTime

Specifies the end of a time range for which this cmdlet gets usage metrics. Specify a time at least two hours earlier. If you do not specify an end time, this cmdlet uses the last aggregation interval currently available.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Filter

Specifies an OData filter clause to use to filter the metrics that this cmdlet retruns. The only valid property is poolId with a string value. Possible operations are the following: eq, ge, gt, le, lt, startswith.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StartTime

Specifies the start of a time range for which this cmdlet gets usage metrics. Specify a time at least two and a half hours earlier. If you do not specify a start time, this cmdlet uses the last aggregation interval currently available.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

PSPoolUsageMetrics