Skip to content

feat: add_ref_payload_index_io_read_counter - #9266

Merged
dancixx merged 1 commit into
devfrom
feat/add-ref-payload-index-read-io-counter
Jun 2, 2026
Merged

dancixx merged 1 commit into
devfrom
feat/add-ref-payload-index-read-io-counter

Conversation

@dancixx

@dancixx dancixx commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

All Submissions:

⚠️ PRs must target the dev branch. If your PR targets master, please change the base branch to dev before requesting a review.

  • My PR targets the dev branch (not master) and my branch was created from dev.
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --workspace --all-features command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@coderabbitai

coderabbitai Bot commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This pull request adds a single new method, ref_payload_index_io_read_counter(), to the HardwareCounterCell struct. The method is marked #[inline] and returns an HwMetricRefCounter that wraps the payload_index_io_read_counter field. This accessor follows the existing pattern of referenced-counter methods in the struct and provides a borrowed reference interface to the payload index IO read metric.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Hop, hop—a counter arrives!
For index reads, metrics thrive,
Borrowed refs in borrowed time,
Five lines of code, perfectly fine!
The hardware sings in referenced rhyme. 🎵

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description contains only a contribution checklist template with no actual explanation of the changes or why they're needed. Add a meaningful description explaining what the new method does, why it's needed, and any relevant implementation details or testing information.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding a new referenced-counter accessor method for payload index IO read counter on HardwareCounterCell.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dancixx
dancixx requested a review from JojiiOfficial June 2, 2026 14:31
@dancixx
dancixx marked this pull request as ready for review June 2, 2026 14:31

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
lib/common/common/src/counter/referenced_counter.rs (1)

50-53: Confirm accessor wiring; check integration/usages

  • HardwareCounterCell defines pub(super) payload_index_io_read_counter: CounterCell and initializes it, so HwMetricRefCounter::new(&self.payload_index_io_read_counter) is well-formed.
  • Repo-wide search finds ref_payload_index_io_read_counter() only at its definition (no call sites). If the PR intends to expose new metrics, wire this accessor into the relevant reader; otherwise leave as preparatory code (ideally document the intent).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/common/common/src/counter/referenced_counter.rs` around lines 50 - 53,
The accessor ref_payload_index_io_read_counter() is implemented but unused;
confirm whether it should be exposed to consumers or left as preparatory code:
if it must be wired up, call
HwMetricRefCounter::new(&self.payload_index_io_read_counter) from the
appropriate reader/collector (e.g., wherever other ref_* accessors are consumed)
and add tests that the metric is observed; otherwise mark the method as
intentionally preparatory by adding a short doc comment on
ref_payload_index_io_read_counter (or on the HardwareCounterCell field
payload_index_io_read_counter) stating it’s added for future metric exposure and
keep it private/unreferenced until wired.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@lib/common/common/src/counter/referenced_counter.rs`:
- Around line 50-53: The accessor ref_payload_index_io_read_counter() is
implemented but unused; confirm whether it should be exposed to consumers or
left as preparatory code: if it must be wired up, call
HwMetricRefCounter::new(&self.payload_index_io_read_counter) from the
appropriate reader/collector (e.g., wherever other ref_* accessors are consumed)
and add tests that the metric is observed; otherwise mark the method as
intentionally preparatory by adding a short doc comment on
ref_payload_index_io_read_counter (or on the HardwareCounterCell field
payload_index_io_read_counter) stating it’s added for future metric exposure and
keep it private/unreferenced until wired.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 7c023a4b-5c24-434e-b3d8-93fe6b58bea5

📥 Commits

Reviewing files that changed from the base of the PR and between d06668f and 72435eb.

📒 Files selected for processing (1)
  • lib/common/common/src/counter/referenced_counter.rs

@dancixx
dancixx merged commit b5acc80 into dev Jun 2, 2026
12 checks passed
@dancixx
dancixx deleted the feat/add-ref-payload-index-read-io-counter branch June 2, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants