extensions
extensions copied to clipboard
ResourceUtilizationHealthCheck only reports CPU _or_ memory issues, not both
Description
When checking health based on resource utilization, the conditions are checked in series and only the first failure is reported. https://github.com/dotnet/extensions/blob/68810ca7399be38b8490a114ef52fdae4ce00058/src/Libraries/Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization/ResourceUtilizationHealthCheck.cs#L39-L60
Reproduction Steps
Test on a system with both high CPU and memory.
Expected behavior
Both CPU and memory issues should be reported.
Actual behavior
Only the first issue found is reported.
Regression?
No response
Known Workarounds
No response
Configuration
8.0
Other information
Recommendation: ResourceUtilizationHealthCheck should be split into two IHealthCheck implementations, one for CPU and one for memory. That way both states can be reported independently.