Share via


Container.ReadThroughputAsync Methode

Definition

Überlädt

ReadThroughputAsync(CancellationToken)

Ruft den Containerdurchsatz bei der Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst ab.

ReadThroughputAsync(RequestOptions, CancellationToken)

Ruft den Containerdurchsatz bei der Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst ab.

ReadThroughputAsync(CancellationToken)

Ruft den Containerdurchsatz bei der Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst ab.

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

Parameter

cancellationToken
CancellationToken

(Optional) CancellationToken stellt die Anforderungsabbruch dar.

Gibt zurück

Bereitgestellter Durchsatz in Anforderungseinheiten pro Sekunde

Beispiele

Das folgende Beispiel zeigt, wie Sie den Durchsatz abrufen.

int? throughput = await container.ReadThroughputAsync();

Hinweise

Null-Wert gibt einen Container ohne bereitgestellten Durchsatz an.

Gilt für:

ReadThroughputAsync(RequestOptions, CancellationToken)

Ruft den Containerdurchsatz bei der Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst ab.

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)

Parameter

requestOptions
RequestOptions

Die Optionen für die Durchsatzanforderung.

cancellationToken
CancellationToken

(Optional) CancellationToken stellt die Anforderungsabbruch dar.

Gibt zurück

Die Durchsatzantwort

Beispiele

Das folgende Beispiel zeigt, wie Der Durchsatz abgerufen wird

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

Das folgende Beispiel zeigt, wie Sie Durchsatz, MinThroughput und wird in Bearbeitung ersetzt.

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}");

Hinweise

Weitere Informationen zum Bereitstellungsangebotsdurchsatz http://azure.microsoft.com/documentation/articles/documentdb-performance-levels/ finden Sie unter.

Gilt für: