Adding basic request diagnostics for V3#615
Conversation
|
Please include the new contracts and usage into the description. |
kirankumarkolli
left a comment
There was a problem hiding this comment.
Why not auto populate always 'PopulateQueryMetrics'?
|
Summary of offline discussion: public class ResponseMessage
{
....
public string GetDiagnostics()
{
return this.cosmosDiag.ToString();
}
}
Example diagnostic string:
{
Summary: E200,
Diag: {
...
}
.....
}
internal CosmosDiagnostics
{
} |
kirankumarkolli
left a comment
There was a problem hiding this comment.
Please refresh contract as listed in comments
|
I realise this has been merged but I can't find any technical documentation on it. I tried to use this to get the total results for paging. Ie user is viewing 1-100 of 1000 items type scenario. However I set up 3 items in the db - the first 2 had property Key1 set to "A" and the third Key1 set to "B". If I search for items where Key1 = "A" and look at the diagnostics object and inside that the query stats then the RetrievedDocumentCount it is 3 and not 2. The third item did not qualify for the query. Is this expected bahaviour? If so I cannot use it to get a total item count for the paging scenario. This is compounded by https://feedback.azure.com/forums/263030-azure-cosmos-db/suggestions/36142468-make-count-aware-of-indexes never having been implemented because we have to have a second query to count the total number of qualifying items for search criteria and it performs woefully because no indexes are used for the count query so this is causing huge performance issues. |
|
@AlanMacdonald can you create a new issue for this? Commenting on a closed PR is difficult to track. This might be fixed by one of the several changes that will go out in the next release. |
This PR will add the basic point operation statistics and query metrics for both type and stream api.
We are exposing GetDiagnostics() on the responses for users to get the diagnostic string.
closes #645