Skip to content

Conversation

@Wraith2
Copy link
Contributor

@Wraith2 Wraith2 commented Apr 10, 2022

When using dotnet-trace of other method to collect event traces the managed SNI implementation uses a different disposable scope object to other parts of the library, it uses TrySNIEventScope instead of TryEventScope. While investigating #1543 I saw that that there are two issues with TrySNIEventScope 1) that is is not conditionally checked so it always generates strings and longs as well as spending time formatting 2) the create message contains only the name of the class not the member name or the scopeid meaning that the open and close scopes cannot be correleated.

This PR changes these using the existing patterns found in TryEventScope. It also changes to use string interpolation because when we get a .net 6+ build these will be optimized by the compiler using interpolated string builder.

It changes the trace output from:
Capture before

to:
Capture after

@JRahnama JRahnama merged commit 11f6ad0 into dotnet:main Apr 29, 2022
@Wraith2 Wraith2 deleted the fix-sniscope branch May 28, 2022 10:54
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.

5 participants