fix: shelf reports double power#4254
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a firmware-/module-aware correction for shelf PSU “power drawn” reporting, and uses that value as a fallback shelf power source when rail classification can’t reliably determine input/output rails.
Changes:
- Introduce
pkg/powerhelpers to detect whenpsu-power-drawnmust be divided by 8, and to track the minimum (oldest) module firmware version seen. - Update both ZapiPerf and RestPerf disk plugins to (a) aggregate
psu[-.]power_drawnacross PSUs, (b) capture shelf module type + minimum module firmware, and (c) use PSU-reported power (with correction when needed) when rail classification is unavailable. - Add unit tests for the new correction/version-min helpers.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/power/correction.go | Adds firmware/module-type based detection for divide-by-8 correction and a helper for selecting the minimum firmware version. |
| pkg/power/correction_test.go | Adds unit tests covering thresholds, case-insensitivity, invalid inputs, and version-min behavior. |
| cmd/collectors/zapiperf/plugins/disk/disk.go | Aggregates psu-power-drawn, captures module type + min module firmware, and falls back to corrected PSU power when rails can’t be classified. |
| cmd/collectors/restperf/plugins/disk/disk.go | Same as ZapiPerf path, using REST metric naming and rest shelf/module label sources. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cgrinds
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.