Container.ReadThroughputAsync Container.ReadThroughputAsync Method

Definition

Overloads

ReadThroughputAsync(CancellationToken) ReadThroughputAsync(CancellationToken)

Gets container throughput in measurement of request units per second in the Azure Cosmos service.

ReadThroughputAsync(RequestOptions, CancellationToken) ReadThroughputAsync(RequestOptions, CancellationToken)

Gets container throughput in measurement of request units per second in the Azure Cosmos service.

ReadThroughputAsync(CancellationToken) ReadThroughputAsync(CancellationToken)

Gets container throughput in measurement of request units per second in the Azure Cosmos service.

public abstract System.Threading.Tasks.Task<Nullable<int>> ReadThroughputAsync (System.Threading.CancellationToken cancellationToken = null);
abstract member ReadThroughputAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<int>>

Parameters

cancellationToken
CancellationToken CancellationToken

(Optional) CancellationToken representing request cancellation.

Returns

Provisioned throughput in request units per second

Examples

The following example shows how to get the throughput.


int? throughput = await container.ReadThroughputAsync();

Remarks

Null value indicates a container with no throughput provisioned.

ReadThroughputAsync(RequestOptions, CancellationToken) ReadThroughputAsync(RequestOptions, CancellationToken)

Gets container throughput in measurement of request units per second in the Azure Cosmos service.

public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ThroughputResponse> ReadThroughputAsync (Microsoft.Azure.Cosmos.RequestOptions requestOptions, System.Threading.CancellationToken cancellationToken = null);
abstract member ReadThroughputAsync : Microsoft.Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ThroughputResponse>

Parameters

requestOptions
RequestOptions RequestOptions

(Optional) The options for the throughput request.RequestOptions

cancellationToken
CancellationToken CancellationToken

(Optional) CancellationToken representing request cancellation.

Returns

The throughput response

Examples

The following example shows how to get the throughput


ThroughputProperties throughputProperties = await container.ReadThroughputAsync();
Console.WriteLine($"Throughput: {throughputProperties?.Throughput}");

The following example shows how to get throughput, MinThroughput and is replace in progress


ThroughputResponse response = await container.ReadThroughputAsync();
Console.WriteLine($"Throughput: {response.Resource?.Throughput}");
Console.WriteLine($"MinThroughput: {response.MinThroughput}");
Console.WriteLine($"IsReplacePending: {response.IsReplacePending}");

Remarks

Refer to http://azure.microsoft.com/documentation/articles/documentdb-performance-levels/ for details on provision offer throughput.

Applies to