-
Notifications
You must be signed in to change notification settings - Fork 121
Use a singular option for all counter intervals #944
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
Conversation
src/Microsoft.Diagnostics.Monitoring.Options/GlobalCounterOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Diagnostics.Monitoring.Options/GlobalCounterOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Diagnostics.Monitoring.WebApi/Controllers/DiagController.Metrics.cs
Show resolved
Hide resolved
src/Microsoft.Diagnostics.Monitoring.Options/GlobalCounterOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Diagnostics.Monitoring.WebApi/Controllers/DiagController.cs
Outdated
Show resolved
Hide resolved
src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/CollectionRuleOptionsTests.cs
Outdated
Show resolved
Hide resolved
src/Tools/dotnet-monitor/CollectionRules/Options/Actions/CollectTraceOptions.Validate.cs
Outdated
Show resolved
Hide resolved
5279086 to
3517d35
Compare
src/Microsoft.Diagnostics.Monitoring.WebApi/Validation/CounterValidator.cs
Outdated
Show resolved
Hide resolved
| const double ExpectedGreaterThan = 0.5; | ||
| const double ExpectedLessThan = 0.75; | ||
| TimeSpan ExpectedDuration = TimeSpan.FromSeconds(30); | ||
| const int ExpectedFrequency = 5; |
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.
Note that metricsRefreshInterval is still in the test api, but it's simply ignored.
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.
That can be fixed after these are merged.
|
|
||
| internal static class GlobalCounterOptionsExtensions | ||
| { | ||
| public static int GetIntervalSeconds(this GlobalCounterOptions options) => |
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.
I like this better than our current scattering usage of GetValueOrDefault everywhere. Separately, I think we should do this with all of the nullable options properties.
|
The only hesitation that I have about this change is that it is using |
This is a reasonable concern. I think we can also address this by making sure things that depend on the interval properly reset their state when the configuration changes. |
3517d35 to
9ac77bc
Compare
I think the least acceptable scenario with this type of behavior would be cancelling a trace from the |
Not done: