feat:Add a new API method to time currently unsupported datastore method calls. #2320
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
Adds a new public API for timing unsupported datastore calls called
RecordDatastoreSegment
, To support this, a new IDisposable type has been added to the API called SegmentWrapper that creates and ends segments. It has a private constructor and uses static methods to create segments, currently only Datastore segments, to allow it to be extended to other segment types in the future.The RecordDatastoreSegment API call requires a vendor name, model, and operation since this are needed to make useful datastore segments. There are four optional parameters to capture more of the rest of data used to make sql traces. Not included were query parameters since that would require the other data to be in a very specific format that I don't think would be intuitive for out customers.
Includes unit tests for the added TransactionBridgeApi method and integration tests for the rest of the work.
API:
Example:
Author Checklist
Reviewer Checklist