-
Notifications
You must be signed in to change notification settings - Fork 292
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
Adding EventSource to NetFx #399
Conversation
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/DataException.cs
Outdated
Show resolved
Hide resolved
What consumes the messages that the BID tracing produced? There's a lot of information embedded in the strings and i'm not sure if it needs to remain in that format or if it could be split out as event properties so you can use them for filtering or grouping in consuming tools like perfview. I'm not a big fan of the field access for the event source instance |
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/Server/SmiEventSink_Default.cs
Outdated
Show resolved
Hide resolved
I had a read through https://github.com/Microsoft/dotnet-samples/blob/master/Microsoft.Diagnostics.Tracing/EventSource/docs/EventSource.md earlier and I think the new |
@Wraith2 the |
Excellent, missed that then 😁
Yeah, and it is. But it's a guideline and not a requirement and code is for humans to read so if the computer doesn't like it we can shut it up but the pattern of calling The doc I linked is the design/usage documentation from the original implementation. It was made for corefx and backported to netfx so the guidance there is first party and quite useful I found. |
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.
I haven't gotten all the way through yet, but wanted to post what I've done so far. In general, it looks good.
I generally agree with Wraith2 on naming it Log instead of _log for readability. I think we can suppress the naming violation.
As Wraith2 also mentioned, You need to surround _log.* calls with an if (_log.IsTraceEnabled())
block everywhere you are passing in a string that will be formatted before it is passed into the trace function to avoid the performance penalty of formatting and allocating a new string during the function call.
...Client/netfx/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationTimeoutRetryHelper.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommandSet.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/EventSource/EventSourceTest.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/EventSource/EventSourceTest.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlTransaction.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlClientLogger.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlDataReaderSmi.cs
Show resolved
Hide resolved
…nto EventSource # Conflicts: # src/Microsoft.Data.SqlClient/tests/ManualTests/EventSource/EventSourceTest.cs
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.
Need more changes.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/DataException.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlClientEventSource.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs
Outdated
Show resolved
Hide resolved
...rosoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnectionFactory.cs
Outdated
Show resolved
Hide resolved
...soft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnectionPoolGroupProviderInfo.cs
Outdated
Show resolved
Hide resolved
* EventTrace for NetFx, changes made to SqlConnection * EventSource for NetFx * Adding IsTraceEnabled * EventSource NetFx to Review * Taking unused variable out * Ignore on .NetCore * Update EventSourceTest.cs * Adding if blocks * EventSource * Documentation * Adding Tests and documentation * Fixing Tests issues in NetCore * moving from Functional to Manual Tests * EventSource * EventSource unwanted reference * Taking extra documentation file out. * Deleting unwanted file from NetCore * EventSource * Additional Improvments * Taking the Static reference out * Removing Extra lines and unwanted SqlClient Reference from SqlClientEventSource * Changing documentation and adding Advanced Keyword * Adding Overloaded methods in EventSource * Fixing test issues * more fixes * EventSource * ActivityCorrelator added. * ActivityCorrelator added. * fixing AdvanceTraceOn issues * StateDump * Removing if statement from code and placing them inside EventSource * integrating SqlEventSource to SqlClientEventSource * Adding null value checker to SqlDependencyListener EventSource logger * EventSource * Fixing ScopeLeave related logic * Fixing PR issues and Tests * EventSource * EventSource * EventSource * Removing Doc * ExceptionTrace Fix * Update SqlAuthenticationProviderManager.cs * Update SqlBulkCopy.cs * Update SqlConnectionFactory.cs * Update SqlConnectionPoolGroupProviderInfo.cs * Update SqlCommand.cs
This PR removes references to Bid class and replaces them with references to SqlClientEventSource.