Skip to content

Conversation

@Wraith2
Copy link
Contributor

@Wraith2 Wraith2 commented Jul 28, 2021

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.

@cheenamalhotra cheenamalhotra added the Code Health 💊 Issues/PRs that are targeted to source code quality improvements. label Aug 20, 2021
@Wraith2 Wraith2 force-pushed the simplify-diagnostics branch from cbeda93 to 147a2d7 Compare August 28, 2021 19:35
{
_diagnosticListener.WriteCommandAfter(operationId, this, _transaction);
}
WriteEndExecuteEvent(success, sqlExceptionNumber, synchronous: true);
Copy link
Contributor Author

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.

@Wraith2 Wraith2 force-pushed the simplify-diagnostics branch from 147a2d7 to 2b885b0 Compare October 2, 2021 00:22
@Wraith2
Copy link
Contributor Author

Wraith2 commented Oct 8, 2021

@cheenamalhotra can i get some reviews on this please. I'd like to clear my backlog.

}
}

internal ref struct DiagnosticScope //: IDisposable //ref structs cannot implement interfaces but the compiler will use pattern matching
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting

@Wraith2 Wraith2 force-pushed the simplify-diagnostics branch from 2b885b0 to 81a21a8 Compare October 9, 2021 00:23
@JRahnama JRahnama merged commit da1f9ab into dotnet:main Oct 15, 2021
@Wraith2 Wraith2 deleted the simplify-diagnostics branch November 25, 2021 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Health 💊 Issues/PRs that are targeted to source code quality improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants