Edit

Share via


Get-AzBatchPoolUsageMetric

Gets pool usage metrics for a Batch account.

Syntax

Default (Default)

Get-AzBatchPoolUsageMetric
    [-StartTime <DateTime>]
    [-EndTime <DateTime>]
    [-Filter <String>]
    -BatchContext <BatchAccountContext>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Get-AzBatchPoolUsageMetric 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

$Context = Get-AzBatchAccountKey -AccountName "ContosoBatchAccount"
$StartTime = Get-Date -Date "2016-05-16 00:00:00Z"
$EndTime = Get-Date -Date "2016-05-16 01:00:00Z"
Get-AzBatchPoolUsageMetric -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-AzBatchAccountKey. 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

Get-AzBatchPoolUsageMetric -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.

Parameters

-BatchContext

Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. If you use the Get-AzBatchAccount cmdlet to get your BatchAccountContext, then Microsoft Entra authentication will be used when interacting with the Batch service. To use shared key authentication instead, use the Get-AzBatchAccountKey cmdlet to get a BatchAccountContext object with its access keys populated. When using shared key authentication, the primary access key is used by default. To change the key to use, set the BatchAccountContext.KeyInUse property.

Parameter properties

Type:BatchAccountContext
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-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.

Parameter properties

Type:

Nullable<T>[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:False
Value from remaining arguments:False

-Filter

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

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:False
Value from remaining arguments: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.

Parameter properties

Type:

Nullable<T>[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:False
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

BatchAccountContext

Outputs

PSPoolUsageMetrics