Skip to content

feat(metrics): Adding the metadata_cache read count metric#4784

Open
thrivikram-karur-g wants to merge 2 commits into
masterfrom
vikram-metadata-cache-read-count-metric
Open

feat(metrics): Adding the metadata_cache read count metric#4784
thrivikram-karur-g wants to merge 2 commits into
masterfrom
vikram-metadata-cache-read-count-metric

Conversation

@thrivikram-karur-g

Copy link
Copy Markdown
Contributor

Please ensure your PR title follows the format:

type(scope): subject

Example:
feat(api): add user login endpoint

Available types:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit

Description

Adding a metric to capture the metadata cache reads.
Hits & misses, more detail on the cache lookup and if cached entry is positive or negative.

Link to the issue in case of a bug fix.

b/512002923

Testing details

  1. Manual - NA
  2. Unit tests - NA
  3. Integration tests - NA

Any backward incompatible change? If so, please explain.

N/A

@thrivikram-karur-g thrivikram-karur-g requested a review from a team as a code owner June 16, 2026 11:30
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request adds observability to the metadata cache by implementing a new read count metric. By tracking cache hits and misses along with the status of entries, this change provides deeper insights into cache efficiency and lookup behavior, which is critical for debugging and performance tuning in the GCSFuse file system.

Highlights

  • Metric Implementation: Introduced the metadata_cache/read_count metric to track cache lookup performance, including hits, misses, and entry status (positive/negative).
  • StatCache Integration: Updated StatCacheBucketView to accept a MetricHandle, enabling instrumentation of cache lookups within the metadata cache layer.
  • Testing and Validation: Added comprehensive unit and integration tests to verify metric accuracy across various cache scenarios, including TTL expiration and negative cache hits.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Jun 16, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request integrates metadata cache read count metrics tracking into gcsfuse. It updates NewStatCacheBucketView to accept a metrics.MetricHandle and records cache hits, misses, entry statuses (positive/negative), and lookup details (found, not found, TTL expired). Additionally, it updates existing tests to use no-op metrics, adds comprehensive unit and integration tests for the new metrics, registers the "metadata_cache/" prefix, and fixes formatting in test utility assertion failures. There are no review comments, so no feedback is provided.

@thrivikram-karur-g thrivikram-karur-g removed the request for review from geertj June 17, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant