Database.ReplaceThroughputAsync Methode

Definition

Überlädt

ReplaceThroughputAsync(ThroughputProperties, RequestOptions, CancellationToken)

Legt den für eine Datenbank bereitgestellten Durchsatz zur Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst fest.

ReplaceThroughputAsync(Int32, RequestOptions, CancellationToken)

Legt den für eine Datenbank bereitgestellten Durchsatz zur Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst fest.

ReplaceThroughputAsync(ThroughputProperties, RequestOptions, CancellationToken)

Quelle:
Database.cs

Legt den für eine Datenbank bereitgestellten Durchsatz zur Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst fest.

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 Cosmos-Datenbankdurchsatz, 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 manuellen Durchsatz ersetzen.

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

Im folgenden Beispiel wird gezeigt, wie Der bereitgestellte Durchsatz mit automatischer Skalierung ersetzt wird.

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

Hinweise

Anforderungseinheiten: Festlegen des Durchsatzes für eine Datenbank

Gilt für:

ReplaceThroughputAsync(Int32, RequestOptions, CancellationToken)

Quelle:
Database.cs

Legt den für eine Datenbank bereitgestellten Durchsatz zur Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst fest.

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-Datenbankdurchsatz, 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.cosmosDatabase.ReplaceThroughputAsync(10000);

Hinweise

Anforderungseinheiten

Gilt für: