Skip to content

Commit 4cb07e8

Browse files
Merge pull request #267449 from jcocchi/update-query-metrics-ru
Cosmos DB: add request charge to query metrics doc
2 parents 40f66d7 + e992836 commit 4cb07e8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

articles/cosmos-db/nosql/query-metrics-performance.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.custom: devx-track-csharp, devx-track-dotnet
1212
# Get SQL query execution metrics and analyze query performance using .NET SDK
1313
[!INCLUDE[NoSQL](../includes/appliesto-nosql.md)]
1414

15-
This article presents how to profile SQL query performance on Azure Cosmos DB using [ServerSideCumulativeMetrics](/dotnet/api/microsoft.azure.cosmos.serversidecumulativemetrics) retrieved from the .NET SDK. `ServerSideCumulativeMetrics` is a strongly typed object with information about the backend query execution. It contains cumulative metrics that are aggregated across all physical partitions for the request, and a list of metrics for each physical partition. These metrics are documented in more detail in the [Tune Query Performance](./query-metrics.md#query-execution-metrics) article.
15+
This article presents how to profile SQL query performance on Azure Cosmos DB using [ServerSideCumulativeMetrics](/dotnet/api/microsoft.azure.cosmos.serversidecumulativemetrics) retrieved from the .NET SDK. `ServerSideCumulativeMetrics` is a strongly typed object with information about the backend query execution. It contains cumulative metrics that are aggregated across all physical partitions for the request, a list of metrics for each physical partition, and the total request charge. These metrics are documented in more detail in the [Tune Query Performance](./query-metrics.md#query-execution-metrics) article.
1616

1717
## Get query metrics
1818

@@ -85,7 +85,7 @@ DoSomeLogging(totalTripsExecutionTime);
8585

8686
### Partitioned Metrics
8787

88-
`ServerSideCumulativeMetrics` contains a `PartitionedMetrics` property that is a list of per-partition metrics for the round trip. If multiple physical partitions are reached in a single round trip, then metrics for each of them appear in the list. Partitioned metrics are represented as [ServerSidePartitionedMetrics](/dotnet/api/microsoft.azure.cosmos.serversidepartitionedmetrics) with a unique identifier for each physical partition.
88+
`ServerSideCumulativeMetrics` contains a `PartitionedMetrics` property that is a list of per-partition metrics for the round trip. If multiple physical partitions are reached in a single round trip, then metrics for each of them appear in the list. Partitioned metrics are represented as [ServerSidePartitionedMetrics](/dotnet/api/microsoft.azure.cosmos.serversidepartitionedmetrics) with a unique identifier for each physical partition and request charge for that partition.
8989

9090
```csharp
9191
// Retrieve the ServerSideCumulativeMetrics object from the FeedResponse
@@ -124,7 +124,9 @@ foreach(var partitionGroup in groupedPartitionMetrics)
124124

125125
## Get the query request charge
126126

127-
You can capture the request units consumed by each query to investigate expensive queries or queries that consume high throughput. You can get the request charge by using the `RequestCharge` property in `FeedResponse`. To learn more about how to get the request charge using the Azure portal and different SDKs, see [find the request unit charge](find-request-unit-charge.md) article.
127+
You can capture the request units consumed by each query to investigate expensive queries or queries that consume high throughput. You can get the total request charge using the `TotalRequestCharge` property in `ServerSideCumulativeMetrics` or you can look at the request charge from each partition using the `RequestCharge` property for each `ServerSidePartitionedMetrics` returned.
128+
129+
The total request charge is also available using the `RequestCharge` property in `FeedResponse`. To learn more about how to get the request charge using the Azure portal and different SDKs, see [find the request unit charge](find-request-unit-charge.md) article.
128130

129131
```csharp
130132
QueryDefinition query = new QueryDefinition("SELECT TOP 5 * FROM c");

0 commit comments

Comments
 (0)