Container.ReplaceThroughputAsync Methode

Definition

Überlädt

ReplaceThroughputAsync(ThroughputProperties, RequestOptions, CancellationToken)

Legt den Durchsatz fest, der für einen Container bei der Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst bereitgestellt wird.

ReplaceThroughputAsync(Int32, RequestOptions, CancellationToken)

Legt den Durchsatz fest, der für einen Container bei der Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst bereitgestellt wird.

ReplaceThroughputAsync(ThroughputProperties, RequestOptions, CancellationToken)

Legt den Durchsatz fest, der für einen Container bei der Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst bereitgestellt wird.

public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ThroughputResponse> ReplaceThroughputAsync (Microsoft.Azure.Cosmos.ThroughputProperties throughputProperties, Microsoft.Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ReplaceThroughputAsync : Microsoft.Azure.Cosmos.ThroughputProperties * Microsoft.Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ThroughputResponse>
Public MustOverride Function ReplaceThroughputAsync (throughputProperties As ThroughputProperties, Optional requestOptions As RequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ThroughputResponse)

Parameter

throughputProperties
ThroughputProperties

Der In Anforderungseinheiten pro Sekunde ausgedrückte Cosmos-Containerdurchsatz.

requestOptions
RequestOptions

(Optional) Die Optionen für die Durchsatzanforderung.

cancellationToken
CancellationToken

(Optional) CancellationToken stellt den Anforderungsabbruch dar.

Gibt zurück

Die Durchsatzantwort.

Beispiele

Im folgenden Beispiel wird gezeigt, wie der feste Durchsatz ersetzt wird.

ThroughputResponse throughput = await this.cosmosContainer.ReplaceThroughputAsync(
    ThroughputProperties.CreateManualThroughput(10000));

Im folgenden Beispiel wird gezeigt, wie sie den bereitgestellten Durchsatz mit automatischer Skalierung ersetzen.

ThroughputResponse throughput = await this.cosmosContainer.ReplaceThroughputAsync(
    ThroughputProperties.CreateAutoscaleThroughput(10000));

Hinweise

Anforderungseinheiten: Festlegen des Durchsatzes für einen Container

Gilt für:

ReplaceThroughputAsync(Int32, RequestOptions, CancellationToken)

Legt den Durchsatz fest, der für einen Container bei der Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst bereitgestellt wird.

public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ThroughputResponse> ReplaceThroughputAsync (int throughput, Microsoft.Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ReplaceThroughputAsync : int * Microsoft.Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ThroughputResponse>
Public MustOverride Function ReplaceThroughputAsync (throughput As Integer, Optional requestOptions As RequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ThroughputResponse)

Parameter

throughput
Int32

Der Cosmos-Containerdurchsatz, ausgedrückt in Anforderungseinheiten pro Sekunde.

requestOptions
RequestOptions

(Optional) Die Optionen für die Durchsatzanforderung.

cancellationToken
CancellationToken

(Optional) CancellationToken stellt den Anforderungsabbruch dar.

Gibt zurück

Die Durchsatzantwort.

Beispiele

Das folgende Beispiel zeigt, wie Sie den Durchsatz abrufen.

ThroughputResponse throughput = await this.cosmosContainer.ReplaceThroughputAsync(400);

Hinweise

https://docs.microsoft.com/azure/cosmos-db/request-units weitere Informationen zum Bereitstellungsdurchsatz.

Gilt für: