fix(gcs_reader): gcs_download_bytes_count metrics is broken by raj-prince · Pull Request #3895 · GoogleCloudPlatform/gcsfuse (original) (raw)

Conversation

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

[ Show hidden characters]({{ revealButtonHref }})

@raj-prince

Description

b/443637302

Testing details

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

Any backward incompatible change? If so, please explain.

No

@raj-prince

@raj-prince

@github-actions

@github-actions

@raj-prince

@kislaykishore

[gemini-code-assist[bot]](/apps/gemini-code-assist)

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 effectively resolves the issue of duplicate instrumentation for gcs/download_bytes_count metrics. The core fix, which involves relocating the metric capturing logic to the startRead function, is sound and correctly ensures that metrics are recorded only once when a new GCS read is initiated. The propagation of the readType to the underlying readers is also handled well. I appreciate the thoroughness of adding new tests to cover both the old and new reader paths for sequential and random reads. My main feedback is a suggestion to refactor the new tests to reduce code duplication, which will improve maintainability.

@codecov

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.37%. Comparing base (404f301) to head (c2bc761).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files

@@ Coverage Diff @@ ## master #3895 +/- ##

Flag Coverage Δ
unittests 82.37% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:

@raj-prince

@kislaykishore

[gemini-code-assist[bot]](/apps/gemini-code-assist)

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 effectively addresses the issue of broken gcs_download_bytes_count metrics by correcting the duplicate instrumentation and ensuring the proper propagation of the read type. The refactoring to pass the read type as part of the request rather than holding it as state in the reader is a good improvement. The addition of specific tests for sequential and random read metrics provides good coverage for the fix. I have one suggestion to improve the maintainability of the new test code.

kislaykishore

Labels

remind-reviewers

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

2 participants

@raj-prince @kislaykishore