Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Container.ReadThroughputAsync Method
Definition
- Namespace:
- Microsoft.Azure.Cosmos
- Assembly:
- Microsoft.Azure.Cosmos.Client.dll
- Package:
- Microsoft.Azure.Cosmos v3.58.0
- Package:
- Microsoft.Azure.Cosmos v3.59.0-preview.0
Important
Some information relates to prerelease product that may be substantially modified before itβs released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| ReadThroughputAsync(CancellationToken) |
Gets container throughput in measurement of request units per second in the Azure Cosmos service. |
| ReadThroughputAsync(RequestOptions, CancellationToken) |
Gets container throughput in measurement of request units per second in the Azure Cosmos service. |
ReadThroughputAsync(CancellationToken)
- Source:
- Container.cs
Gets container throughput in measurement of request units per second in the Azure Cosmos service.
public abstract System.Threading.Tasks.Task<int?> ReadThroughputAsync(System.Threading.CancellationToken cancellationToken = default);
abstract member ReadThroughputAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<int>>
Public MustOverride Function ReadThroughputAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Nullable(Of Integer))
Parameters
- 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.
Applies to
ReadThroughputAsync(RequestOptions, CancellationToken)
- Source:
- Container.cs
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 = default);
abstract member ReadThroughputAsync : Microsoft.Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ThroughputResponse>
Public MustOverride Function ReadThroughputAsync (requestOptions As RequestOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ThroughputResponse)
Parameters
- requestOptions
- RequestOptions
The options for the throughput request.
- cancellationToken
- CancellationToken
(Optional) CancellationToken representing request cancellation.
Returns
The throughput response
Examples
The following example shows how to get the throughput
RequestOptions requestOptions = new RequestOptions();
ThroughputProperties throughputProperties = await container.ReadThroughputAsync(requestOptions);
Console.WriteLine($"Throughput: {throughputProperties?.Throughput}");
The following example shows how to get throughput, MinThroughput and is replace in progress
RequestOptions requestOptions = new RequestOptions();
ThroughputResponse response = await container.ReadThroughputAsync(requestOptions);
Console.WriteLine($"Throughput: {response.Resource?.Throughput}");
Console.WriteLine($"MinThroughput: {response.MinThroughput}");
Console.WriteLine($"IsReplacePending: {response.IsReplacePending}");
Applies to
Azure SDK for .NET
Feedback
Was this page helpful?
