Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add query plan diagnostics and refactor query diagnostics #1285

Merged
merged 12 commits into from
Mar 20, 2020

Conversation

j82w
Copy link
Contributor

@j82w j82w commented Mar 18, 2020

Pull Request Template

Description

  1. Added query plan diagnostics. This shows if the query was created from a continuation token, gateway (includes all pipeline info), or the service interop.
  2. The diagnostics are now using the query context and client to get and store the information. This removes the need for the query pipeline to aggregate the information.
  3. Removed SchedulingTimeSpan as it is duplicate information.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Example of the first page with pipeline diagnostics.

{
    "Summary": {
        "StartUtc": "2020-03-18T21:08:44.8969049Z",
        "TotalElapsedTime": "00:00:00.0042679",
        "UserAgent": "cosmos-netstandard-sdk/3.7.0|3.7.1|83761|X64|Microsoft Windows 10.0.18363 |.NET Core 4.6.28325.01|",
        "TotalRequestCount": 1,
        "FailedRequestCount": 0
    },
    "Context": [
        {
            "Id": "CreateQueryPipeline",
            "ElapsedTime": "00:00:00.0004811"
        },
        {
            "Id": "ServiceInterop",
            "ElapsedTime": "00:00:00.0002203"
        },
        {
            "PKRangeId": "0",
            "StartUtc": "2020-03-18T21:08:44.8974106Z",
            "QueryMetric": "totalExecutionTimeInMs=0.36;queryCompileTimeInMs=0.05;queryLogicalPlanBuildTimeInMs=0.02;queryPhysicalPlanBuildTimeInMs=0.03;queryOptimizationTimeInMs=0.00;VMExecutionTimeInMs=0.10;indexLookupTimeInMs=0.00;documentLoadTimeInMs=0.03;systemFunctionExecuteTimeInMs=0.00;userFunctionExecuteTimeInMs=0.00;retrievedDocumentCount=1;retrievedDocumentSize=679;outputDocumentCount=1;outputDocumentSize=728;writeOutputTimeInMs=0.00;indexUtilizationRatio=1.00",
            "IndexUtilization": "",
            "Context": [
                {
                    "Id": "AggregatedClientSideRequestStatistics",
                    "ContactedReplicas": [],
                    "RegionsContacted": [
                        "https://127.0.0.1:8081/"
                    ],
                    "FailedReplicas": []
                },
                {
                    "Id": "Microsoft.Azure.Cosmos.Handlers.RetryHandler",
                    "ElapsedTime": "00:00:00.0026608"
                },
                {
                    "Id": "Microsoft.Azure.Cosmos.Handlers.RouterHandler",
                    "ElapsedTime": "00:00:00.0026448"
                },
                {
                    "Id": "TransportHandler",
                    "ElapsedTime": "00:00:00.0026399"
                },
                {
                    "Id": "StoreResponseStatistics",
                    "ResponseTimeUtc": "2020-03-18T21:08:44.8997892Z",
                    "ResourceType": "Document",
                    "OperationType": "Query",
                    "LocationEndpoint": "https://127.0.0.1:8081/",
                    "StoreResult": "StorePhysicalAddress: rntbd://127.0.0.1:10253/apps/DocDbApp/services/DocDbServer23/partitions/a4cb4963-38c8-11e6-8106-8cdcd42c33be/replicas/1p/, LSN: 268, GlobalCommittedLsn: -1, PartitionKeyRangeId: 0, IsValid: True, StatusCode: 200, SubStatusCode: 0, RequestCharge: 2.29, ItemLSN: -1, SessionToken: -1#268, UsingLocalLSN: True, TransportException: null"
                }
            ]
        }
    ]
}

@j82w j82w self-assigned this Mar 18, 2020
@j82w j82w added Diagnostics Issues around diagnostics and troubleshooting QUERY labels Mar 18, 2020
@j82w j82w requested a review from ealsur March 18, 2020 21:14
bchong95
bchong95 previously approved these changes Mar 18, 2020
ealsur
ealsur previously approved these changes Mar 19, 2020
@j82w j82w merged commit 37d054b into master Mar 20, 2020
@j82w j82w deleted the users/jawilley/diagnostics/queryplanv2 branch March 20, 2020 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Diagnostics Issues around diagnostics and troubleshooting QUERY
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants