Freigeben über


CosmosContainer.ReadThroughputAsync Methode

Definition

Überlädt

ReadThroughputAsync(CancellationToken)

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

ReadThroughputAsync(RequestOptions, CancellationToken)

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

ReadThroughputAsync(CancellationToken)

Ruft den Containerdurchsatz bei der Messung von 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 den 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

Der NULL-Wert gibt einen Container ohne bereitgestellten Durchsatz an.

Gilt für:

ReadThroughputAsync(RequestOptions, CancellationToken)

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

public abstract System.Threading.Tasks.Task<Azure.Cosmos.ThroughputResponse> ReadThroughputAsync (Azure.Cosmos.RequestOptions requestOptions, System.Threading.CancellationToken cancellationToken = default);
abstract member ReadThroughputAsync : Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<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.RequestOptions

cancellationToken
CancellationToken

(Optional) CancellationToken stellt den Anforderungsabbruch dar.

Gibt zurück

Die Durchsatzantwort

Beispiele

Im folgenden Beispiel wird gezeigt, wie Sie den Durchsatz abrufen.

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

Im folgenden Beispiel wird gezeigt, wie Sie den Durchsatz, MinThroughput und den Ersetzungsvorgang in Bearbeitung erhalten.

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

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

Gilt für: