Issue #523: hw.network.up metric not reported for WARN or ALARM states #524
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed LinkStatus state mapping.
Details
This pull request includes changes to the
LinkStatus
enum and the addition of a new test class to ensure the correct interpretation of state values. The most important changes include updating theLinkStatus
enum to handle new states and adding a comprehensive test to verify the interpretation logic.Updates to
LinkStatus
enum:metricshub-engine/src/main/java/org/sentrysoftware/metricshub/engine/common/helpers/state/LinkStatus.java
: Added new states "warn" and "alarm" to theLinkStatus
enum and updated the interpretation logic to classify these states asUNPLUGGED
.Addition of test class:
metricshub-engine/src/test/java/org/sentrysoftware/metricshub/engine/common/helpers/state/LinkStatusTest.java
: Added a new test classLinkStatusTest
to verify the correct interpretation of various state values, including the newly added "warn" and "alarm" states.Testing


Before
Reported power: 378W
After
Reported power: 278W