-
Notifications
You must be signed in to change notification settings - Fork 317
Simplify diagnostic tracing #1193
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
Conversation
cbeda93 to
147a2d7
Compare
| { | ||
| _diagnosticListener.WriteCommandAfter(operationId, this, _transaction); | ||
| } | ||
| WriteEndExecuteEvent(success, sqlExceptionNumber, synchronous: true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original code wasn't setting success or reporting the end execute event, so i added them for symmetry with ExecuteScalar and EcecuteReader.
147a2d7 to
2b885b0
Compare
|
@cheenamalhotra can i get some reviews on this please. I'd like to clear my backlog. |
...Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlClientDiagnosticListenerExtensions.cs
Outdated
Show resolved
Hide resolved
| } | ||
| } | ||
|
|
||
| internal ref struct DiagnosticScope //: IDisposable //ref structs cannot implement interfaces but the compiler will use pattern matching |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting
...Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlClientDiagnosticListenerExtensions.cs
Outdated
Show resolved
Hide resolved
2b885b0 to
81a21a8
Compare
Adds scopes for diagnostic tracing and uses them where appropriate in sync methods. Async methods and ConnectionClose still need to do direct api calls to prevent the heap allocation of the scope data and because the close notifications can be conditional.