Expose SqlBatch commands on the command diagnostic payloads - #4577
Draft
PetarJerinic wants to merge 2 commits into
Draft
Expose SqlBatch commands on the command diagnostic payloads#4577PetarJerinic wants to merge 2 commits into
PetarJerinic wants to merge 2 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Author
|
@dotnet-policy-service agree |
Author
|
@cheenamalhotra this PR implements the shape in #4545. Could someone run the pipelines? |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Author
|
@cheenamalhotra I fixed the subscription leak in BatchDiagnosticsTests.cs that caused some of the existing tests to fail. Can we do a fresh /azp run? |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
SqlClientCommandBefore,SqlClientCommandAfter, andSqlClientCommandErrorare extended to contain BatchCommands. It holds batch commands ofSqlBatch.The shape follows what was specified within #4545.
API Changes are additive, and are present in
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.Diagnostics.csand thedoc/snippets/.../SqlClientDiagnostic.xmlIssues
Fixes #4545
Testing
Three new test files:
SqlClientCommandPayloadTest.cs- 9 cases validating three payload types directlySqlDiagnosticListenerTest.cs- 1 case confirmingWriteCommandAfterpassessqlCommand.BatchCommandsthroughBatchDiagnosticsTests.cs- 9 e2e cases withDiagnosticListenersubscriberNote: WriteCommandAfter on a successful batch was not covered. Simulated TDS server cannot answer an RPC. It could be added to
ManualTests/TracingTests/DiagnosticTestwith[Trait("Category", "flaky")], but left it out to avoid adding coverage that can't gate. Happy to add it if it's preferred as a documentation value.