Skip to content

resource_usage_agent: add RocksDB block read count to Top SQL resource dimensions - #1498

Merged
ti-chi-bot[bot] merged 3 commits into
masterfrom
codex/add-resource-metering-block-read-count
Aug 13, 2026
Merged

resource_usage_agent: add RocksDB block read count to Top SQL resource dimensions#1498
ti-chi-bot[bot] merged 3 commits into
masterfrom
codex/add-resource-metering-block-read-count

Conversation

@jiong-nba

@jiong-nba jiong-nba commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What

Add the rocksdb_block_read_count field to GroupTagRecordItem so TiKV can report foreground RocksDB block reads through resource metering.

Issue Number: ref #1507

Ref: tikv/tikv#19867

Validation

  • make check
  • make go

Summary by CodeRabbit

  • New Features
    • Added a RocksDB block-read count metric to resource usage records.
    • Enables more accurate attribution of read I/O activity to downstream workloads.
    • Clarifies that this metric represents RocksDB block reads rather than device-level IOPS.

Signed-off-by: jiong-nba <jiongnba@gmail.com>
Copilot AI review requested due to automatic review settings July 15, 2026 01:17
@ti-chi-bot
ti-chi-bot Bot requested a review from xzhangxian1008 July 15, 2026 01:17
@ti-chi-bot ti-chi-bot Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 15, 2026
@pingcap-cla-assistant

pingcap-cla-assistant Bot commented Jul 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the resource usage metering protobuf schema to allow TiKV to report foreground RocksDB block read counts as part of group-tag resource metering records.

Changes:

  • Added a new rocksdb_block_read_count field to GroupTagRecordItem in resource_usage_agent.proto (field number 9, uint64).
  • Updated the generated Go bindings to include the new field, plus marshal/size/unmarshal support.
  • Updated scripts/proto.lock to reflect the schema change.

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.

File Description
scripts/proto.lock Updates the locked proto schema metadata to include the new field in GroupTagRecordItem.
proto/resource_usage_agent.proto Adds rocksdb_block_read_count to GroupTagRecordItem with tag 9.
pkg/resource_usage_agent/resource_usage_agent.pb.go Regenerates Go protobuf code to include the new field and its serialization logic.
Files not reviewed (1)
  • pkg/resource_usage_agent/resource_usage_agent.pb.go: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: jiong-nba <jiongnba@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • scripts/proto.lock is excluded by !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9622d473-1e74-471e-8066-d8f7a58e5b86

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The resource usage protobuf adds rocksdb_block_read_count to GroupTagRecordItem as field 9. Its documentation identifies the value as a RocksDB block-read count, not a device-level IOPS measurement.

Changes

Resource usage reporting

Layer / File(s) Summary
Add RocksDB block-read count
proto/resource_usage_agent.proto
GroupTagRecordItem now includes the uint64 rocksdb_block_read_count = 9 field with documentation for downstream read-I/O attribution.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related issues

Suggested reviewers: xzhangxian1008

Poem

A rabbit counts blocks in the stream,
Field nine records each read-I/O beam.
RocksDB reads are clear and bright,
Separate from device IOPS in sight.
One small field completes the scheme.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the addition of RocksDB block read counts to the Top SQL resource dimensions.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-resource-metering-block-read-count

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.

@jiong-nba
jiong-nba force-pushed the codex/add-resource-metering-block-read-count branch from fb4b0fd to db3cf69 Compare August 7, 2026 01:46
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@jiong-nba jiong-nba changed the title resource_usage_agent: add RocksDB block read count resource_usage_agent: add RocksDB block read count to Top SQL resource dimensions Aug 7, 2026

@yibin87 yibin87 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.

LGTM

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 13, 2026
@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 13, 2026
@ti-chi-bot

ti-chi-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2026-08-13 01:58:05.677329455 +0000 UTC m=+3270871.713424501: ☑️ agreed by yibin87.
  • 2026-08-13 04:27:34.302285976 +0000 UTC m=+3279840.338381032: ☑️ agreed by nolouch.

@jiong-nba

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@jiong-nba

Copy link
Copy Markdown
Contributor Author

/retest

@ti-chi-bot

ti-chi-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nolouch, XuHuaiyu, yibin87

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the approved label Aug 13, 2026
@ti-chi-bot
ti-chi-bot Bot merged commit af1ad1b into master Aug 13, 2026
7 checks passed
@ti-chi-bot
ti-chi-bot Bot deleted the codex/add-resource-metering-block-read-count branch August 13, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants