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

CosmosDiagnostics: Removes ITrace Caller Info and makes the Dictionary for Data lazy #2988

Merged
merged 2 commits into from
Jan 19, 2022

Conversation

asketagarwal
Copy link
Contributor

@asketagarwal asketagarwal commented Jan 19, 2022

  1. The Trace library always creates a CallerInfo object. This adds overhead to both collecting the trace and the CosmosDiagnostic.ToString() logic. There has been no use case for this information so it should be removed until there is a scenario.

  2. IReadOnlyDictionary should be created lazily. In most traces no data is being added. A static singleton could be used by default.

The object removed:

"caller info": {
                "member": "OperationHelperWithRootTraceAsync",
                "file": "/home/askagarw/azure-cosmos-dotnet-v3/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs",
                "line": 244
            }

Closing issues

To automatically close an issue: closes #2972

@sourabh1007
Copy link
Contributor

Can you please put callerInfo sample in the PR description? What information it use to have?

@j82w j82w changed the title ITrace: Removes Caller Info and makes the Dictionary for Data lazy CosmosDiagnostics: Removes ITrace Caller Info and makes the Dictionary for Data lazy Jan 19, 2022
@j82w j82w merged commit 61c4549 into master Jan 19, 2022
@j82w j82w deleted the users/askagarw/itraceimprovements branch January 19, 2022 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance: CosmosDiagnostics remove callerinfo and make data dictionary lazy
4 participants