Skip to content

fix: shelf reports double power#4254

Merged
cgrinds merged 2 commits into
mainfrom
rg2-shelf-fix
Apr 30, 2026
Merged

fix: shelf reports double power#4254
cgrinds merged 2 commits into
mainfrom
rg2-shelf-fix

Conversation

@rahulguptajss
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 30, 2026 11:44
@cla-bot cla-bot Bot added the cla-signed label Apr 30, 2026
@rahulguptajss rahulguptajss linked an issue Apr 30, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/power helpers to detect when psu-power-drawn must 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_drawn across 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 cgrinds merged commit fcd7272 into main Apr 30, 2026
11 checks passed
@cgrinds cgrinds deleted the rg2-shelf-fix branch April 30, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harvest is reporting double power for shelf

3 participants