CosmosDatabase.ReadThroughputAsync Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Überlädt
ReadThroughputAsync(CancellationToken) |
Ruft den Datenbankdurchsatz bei der Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst ab. |
ReadThroughputAsync(RequestOptions, CancellationToken) |
Ruft den Datenbankdurchsatz bei der Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos-Dienst ab. |
ReadThroughputAsync(CancellationToken)
Ruft den Datenbankdurchsatz 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 den Anforderungsabbruch dar.
Gibt zurück
Bereitgestellter Durchsatz in Anforderungseinheiten pro Sekunde
Beispiele
Das folgende Beispiel zeigt, wie Sie den Datenbankdurchsatz abrufen.
int? throughput = await database.ReadThroughputAsync();
Hinweise
Der NULL-Wert gibt eine Datenbank ohne bereitgestellten Durchsatz an.
https://docs.microsoft.com/azure/cosmos-db/request-unitshttps://docs.microsoft.com/azure/cosmos-db/set-throughput#set-throughput-on-a-database
Gilt für:
ReadThroughputAsync(RequestOptions, CancellationToken)
Ruft den Datenbankdurchsatz bei der Messung der 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 database.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 database.ReadThroughputAsync(requestOptions);
Console.WriteLine($"Throughput: {response.Value?.Throughput}");
Console.WriteLine($"MinThroughput: {response.MinThroughput}");
Console.WriteLine($"IsReplacePending: {response.IsReplacePending}");
Hinweise
Der NULL-Wert gibt eine Datenbank ohne bereitgestellten Durchsatz an.
https://docs.microsoft.com/azure/cosmos-db/request-unitshttps://docs.microsoft.com/azure/cosmos-db/set-throughput#set-throughput-on-a-database
Gilt für:
Azure SDK for .NET