impl(bigtable): change from time weighted average to instant count#16047
impl(bigtable): change from time weighted average to instant count#16047scotthart merged 3 commits intogoogleapis:mainfrom
Conversation
Summary of ChangesHello, 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 refactors the Bigtable channel management to simplify how RPC usage is measured and how the channel pool scales. By moving from a time-weighted average to an instant count for RPCs, the system gains a more immediate and straightforward understanding of channel load. Additionally, the channel pool's sizing logic now proactively considers channels that are currently being provisioned, leading to more responsive and efficient resource allocation. Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
Customization To customize 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The code changes simplify the ChannelUsage class by removing the average_outstanding_rpcs functionality, including its time-based tracking (clock_ and measurements_). This also removes related includes and test cases. In DynamicChannelPool, a num_pending_channels_ counter was introduced to track channels being added. However, a review comment highlights a bug where num_pending_channels_ is incorrectly decremented by the number of successfully created stubs (new_stubs.size()) instead of the number of requested channels (new_channel_ids.size()). This can lead to an inaccurate count if some channel creations fail, potentially preventing future channel additions.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16047 +/- ##
==========================================
- Coverage 92.66% 92.65% -0.01%
==========================================
Files 2341 2341
Lines 215695 215646 -49
==========================================
- Hits 199876 199815 -61
- Misses 15819 15831 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
After further conversations with the Bigtable team, we're going to simplify the RPC use tracking to a simple average of the current RPCs per channel across all the channels. Additionally, pending added channels will be included in the calculations to regulate how often channels are added as opposed to a timer.