Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Merge | Merge metrics/performance counter methodology#3251

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mdaigle merged 8 commits intodotnet:mainfromedwardneal:merge/metrics
Apr 21, 2025

Conversation

edwardneal
Copy link
Contributor

Relates to#1261, but also lays the groundwork for#2211.

SqlClientcurrently has two different ways to record metrics - .NET Core has counters on the EventSource, and .NET Framework has performance counters. These areusually recorded at the same time, but they're separated by various#if NET conditional compilation blocks.

This PR consolidates both metric surfaces into a singleSqlClientMetrics class, with variousHardConnectRequest methods which increment a performance counter or event counter. This means that we've no longer got this type of conditional compilation scattered throughout the connection logic.

@benrr101 - this is the outcome of theconversation we had while merging DbConnectionInternal. I've split it out so it's easier to review.

I'd appreciate a CI run please.

mahara reacted with thumbs up emoji
Move functionality into a new Microsoft.Data.SqlClient.Diagnostics.SqlClientMetrics type. This common interface encapsulates both event counters and performance counters.
@David-Engel
Copy link
Contributor

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@paulmedynskipaulmedynski added this to the6.1-preview1 milestoneApr 2, 2025
@cheenamalhotra
Copy link
Member

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mdaiglemdaigle self-assigned thisApr 2, 2025
@codecovCodecov
Copy link

codecovbot commentedApr 2, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base(c5e3c40) to head(1a82a49).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main   #3251       +/-   ##==========================================- Coverage   72.98%       0   -72.99%==========================================  Files         299       0      -299       Lines       57215       0    -57215     ==========================================- Hits        41760       0    -41760+ Misses      15455       0    -15455
FlagCoverage Δ
addons?
netcore?
netfx?

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@mdaiglemdaigle left a comment

Choose a reason for hiding this comment

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

Overall looks good, but I don't know enough about the test coverage of this functionality to approve just based on a successful CI run. Have you done any manual validation that the events and metrics are still emitted as expected?

Copy link
Contributor

@benrr101benrr101 left a comment

Choose a reason for hiding this comment

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

Overall, love it! 🚀 🚀 🚀
I'd love it more if we can get it all into a single file, but I'll leave that to your judgement.

@paulmedynski
Copy link
Contributor

/azp run

@paulmedynskipaulmedynski self-assigned thisApr 8, 2025
@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@benrr101benrr101 added the Common Project 🚮Things that relate to the common project project labelApr 8, 2025
@benrr101
Copy link
Contributor

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@benrr101
Copy link
Contributor

@edwardneal ok, so looking at these failures, I thiiiink I understand why these failures are happening. Sorta. The MetricsTest file is only pulled into the test project if it's on test set 3 (or no test set), that's why only some of the test jobs are failing (specifically the ones that end with 3). That test file has references to the event source class, which is internal. Since we don't have internalsvisibleto the test projects (yet ...@mdaigle did you give up on that?), I don't think we can access that class from the test project.

The part I don't get tho, if I build it in the IDE, it doesn't complain at all. But that build specifies no test set, which makes me wonder if something including a file or property that makes it all work. Nothing stood out at me, but I didn't go through it with a fine toothed comb.

@mdaigle
Copy link
Contributor

mdaigle commentedApr 10, 2025
edited
Loading

@benrr101 I'm going to revert the change I made to allow internalsVisibleTo because, like you saw, it works in the IDE, but not in MSBuild, which is confusing. MSBuild compiles using the reference assemblies which don't currently contain any of the internal types. Visual studio (and I'm assuming Rider, too) compiles using the implementation assemblies, which do contain the internal types.

#3268

@benrr101
Copy link
Contributor

@edwardneal Update - apparently something is really messed up with how we have our projects set up.... As per@mdaigle, the ref projects are being used for the internalsvisibleto when building from command line, but the implementation projects are being used when building from IDE. Thus, we see the failures of your unit tests when we build the project during CI. I don't think we have a good plan for fixing this anytime soon (it's sort of predicated on a lot of other things being fixed). But in the meantime, Malcolm is going to back out the internalsvisibleto change so people don't get the wrong idea that they can use internal classes in test projects safely.

To address this ... I don't know what's best. I'd like to keep the tests in the codebase so we can use them someday, but maybe just comment them out? (it grosses me out to even type that)

@edwardneal
Copy link
ContributorAuthor

Good catch, thanks - I'd not yet seen the test results. It's worth keeping in mind that this test originally used reflection; I'll swap it back to doing so, and we can avoid the problem completely.

@edwardneal
Copy link
ContributorAuthor

I've adjusted MetricsTest to use reflection again - could I have another CI run please?

@benrr101
Copy link
Contributor

/azp run

benrr101 reacted with thumbs up emoji

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@benrr101
Copy link
Contributor

benrr101 commentedApr 16, 2025
edited
Loading

@edwardneal please don't mind that I just went ahead and fixed the merge conflict for you :)

edwardneal reacted with laugh emoji

@benrr101
Copy link
Contributor

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mdaiglemdaigle merged commit042ea74 intodotnet:mainApr 21, 2025
122 checks passed
@edwardnealedwardneal deleted the merge/metrics branchApril 21, 2025 17:07
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@benrr101benrr101benrr101 approved these changes

@mdaiglemdaiglemdaigle approved these changes

Labels
Common Project 🚮Things that relate to the common project project
Projects
None yet
Milestone
6.1-preview1
Development

Successfully merging this pull request may close these issues.

6 participants
@edwardneal@David-Engel@cheenamalhotra@paulmedynski@benrr101@mdaigle

[8]ページ先頭

©2009-2025 Movatter.jp