-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Simplify initialization of RuntimeMetrics #105539
Conversation
jkotas
commented
Jul 26, 2024
•
edited
Loading
edited
- Trigger the RuntimeMetrics initialization only when actually needed in the MeterListener constructor.
- Delete the lock-ordering workaround and wrong comment introduced in Fix Deadlock Inside Metrics Code #105259. Triggering the RuntimeMetrics initialization only when actually needed should make the lock-ordering workaround unnecessary.
- Trigger the RuntimeMetrics initialization only when actually needed in the MeterListener constructor. - Delete the lock-ordering workaround and wrong comment introduced in dotnet#105259. Trigger the RuntimeMetrics initialization only when actually needed should make the lock-ordering workarond unnecessary.
...braries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/RuntimeMetrics.cs
Outdated
Show resolved
Hide resolved
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.
Happy to take this as-is, or if you wanted to go further you could eliminate all the unused static fields as discussed in the comment. Thanks @jkotas!
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.
❤️
...braries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/RuntimeMetrics.cs
Outdated
Show resolved
Hide resolved
…iagnostics/Metrics/RuntimeMetrics.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.
Thanks @jkotas