-
Notifications
You must be signed in to change notification settings - Fork 808
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
Revive PR - Extend Service Bus with Active and Deadletter-Queue thresholds #1861
Revive PR - Extend Service Bus with Active and Deadletter-Queue thresholds #1861
Conversation
…eMessageCountThresholdHealthCheck.cs Co-authored-by: Ivan Maximov <sungam3r@yandex.ru>
…untThresholdHealthCheck.cs Co-authored-by: Ivan Maximov <sungam3r@yandex.ru>
…eBusDeadLetterQueueMessageThresholdCountUnitTests.cs Co-authored-by: Ivan Maximov <sungam3r@yandex.ru>
…eBusQueueMessageThresholdCountUnitTests.cs Co-authored-by: Ivan Maximov <sungam3r@yandex.ru>
…eBusQueueMessageThresholdCountUnitWithTokenUnitTests.cs Co-authored-by: Ivan Maximov <sungam3r@yandex.ru>
…eBusDeadLetterQueueMessageThresholdCountUnitWithTokenUnitTests.cs Co-authored-by: Ivan Maximov <sungam3r@yandex.ru>
src/HealthChecks.AzureServiceBus/AzureServiceBusQueueMessageCountThresholdHealthCheck.cs
Outdated
Show resolved
Hide resolved
...althChecks.AzureServiceBus/AzureServiceBusDeadLetterQueueMessageCountThresholdHealthCheck.cs
Outdated
Show resolved
Hide resolved
Hi, cc @sungam3r |
...zureServiceBus/Configuration/AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions.cs
Outdated
Show resolved
Hide resolved
src/HealthChecks.AzureServiceBus/AzureServiceBusQueueMessageCountThresholdHealthCheck.cs
Outdated
Show resolved
Hide resolved
…untThresholdHealthCheck.cs
...zureServiceBus/Configuration/AzureServiceBusQueueMessagesCountThresholdHealthCheckOptions.cs
Outdated
Show resolved
Hide resolved
Thanks @sungam3r! I have merged into a single health check - the only down-side is I changed from Let me know what do you think now :) Also I'm wondering if we want to add registration method which supports two |
😕 For struct |
src/HealthChecks.AzureServiceBus/AzureServiceBusQueueMessageCountThresholdHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/HealthChecks.AzureServiceBus/AzureServiceBusQueueMessageCountThresholdHealthCheck.cs
Outdated
Show resolved
Hide resolved
Thanks for your review @sungam3r 😄 I decided to stick with Speaking of
I'm wondering if I should add 2 more:
Or not add it at all. |
When HC provides options object client can specify any configuration in action delegate so no need to provide 100500 extension methods from our side. Imagine you have options object with 10 optional properties inside. Would you provide all combinations for setting those properties? Obviously no. |
...ndencyInjection/AzureServiceBusDeadLetterQueueMessageThresholdCountUnitWithTokenUnitTests.cs
Outdated
Show resolved
Hide resolved
A lot of extensions were added historically before introducing options pattern. I personally dislike those bunch overloads but I did not remove already written ones. For new health checks I do not bother with many extension methods leaning to provide only required minimum - one with |
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #1861 +/- ##
==========================================
- Coverage 68.44% 68.24% -0.21%
==========================================
Files 214 217 +3
Lines 7762 7845 +83
Branches 530 539 +9
==========================================
+ Hits 5313 5354 +41
- Misses 2309 2349 +40
- Partials 140 142 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Thanks for the explanation, @sungam3r. I got fixated to pass Now, as you mentioned, it is as free/open to use as possible, because we expose There are two extension methods in total because there are two ways to authenticate:
Tests are fixed as well :) |
OK, I'm fine to provide 2, but again - these auth combinations are in options. What if you have 5 ways of auth? Would you provide 5 extension methods to connect your HC? What prompted you to choose a method of authentication as a criterion for the number of overloads? All these settings are optional and can generate combinations, especially with further evolution. Subsequently, this can create a design problem when the previously chosen criterion will no longer be so obvious and will have to change the public API. |
In other words |
...lthChecks.AzureServiceBus/DependencyInjection/AzureServiceBusHealthCheckBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
...lthChecks.AzureServiceBus/DependencyInjection/AzureServiceBusHealthCheckBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
...lthChecks.AzureServiceBus/DependencyInjection/AzureServiceBusHealthCheckBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
...lthChecks.AzureServiceBus/DependencyInjection/AzureServiceBusHealthCheckBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
...lthChecks.AzureServiceBus/DependencyInjection/AzureServiceBusHealthCheckBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
...lthChecks.AzureServiceBus/DependencyInjection/AzureServiceBusHealthCheckBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
...lthChecks.AzureServiceBus/DependencyInjection/AzureServiceBusHealthCheckBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
@cieciurm I'll wait for your decision on the number of overloads until tomorrow. |
I am no expert, but I think my pattern of thinking, as well as original PR author's, were inspired by the shape of existing extension methods for Queues. If you see the current overloads of I would rely on your expertise and experience in shaping the public API of a library - if you think it is just causing noise, then let's remove it and have single method. Just let me know what you think and I will adjust the PR tomorrow morning :) |
I merge as is. I still think that the library (almost each HC project) has more extensions to add health checks than necessary, but now is not the time to change the design removing that "noise". |
What this PR does / why we need it:
This PR revives #822
Which issue(s) this PR fixes:
Please reference the issue this PR will close: #821
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
No.
Please make sure you've completed the relevant tasks for this PR, out of the following list: