在Document DB SDK 2.#中,FeedOptions类中有一个名为PopulateQueryMetrics的属性。Cosmos SDK 3.#中的等价物是什么?
IDocumentQuery<dynamic> documentQuery = documentClient.CreateDocumentQuery<dynamic>(
collectionUri,
sqlQuery,
new FeedOptions
{
EnableCrossPartitionQuery = true,
PopulateQueryMetrics = true
});发布于 2020-11-19 00:53:46
您不再需要设置此标志,查询指标(以及其他重要的网络信息和延迟指标)将在FeedResponse.Diagnostics中捕获。参考:https://docs.microsoft.com/dotnet/api/microsoft.azure.cosmos.response-1.diagnostics?view=azure-dotnet#Microsoft_Azure_Cosmos_Response_1_Diagnostics
只捕获此属性的值ToString(),例如:
FeedResponse<T> response = await iterator.ReadNextAsync();
Console.WriteLine(response.Diagnostics.ToString());https://stackoverflow.com/questions/64897063
复制相似问题