Skip to content

Conversation

@shunping
Copy link
Collaborator

@shunping shunping commented Nov 4, 2025

Also clarify the situation in the proto spec.

@shunping shunping changed the title Fix a distribution metric problem when count is zero [Prism] Fix a distribution metric problem when count is zero Nov 4, 2025
@shunping
Copy link
Collaborator Author

shunping commented Nov 4, 2025

R: @lostluck

@shunping shunping requested a review from lostluck November 4, 2025 20:17
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @shunping, 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 resolves an edge case in distribution metric processing where the count of reported elements is zero. It ensures that runners correctly interpret and aggregate these metrics by ignoring potentially misleading sum, min, and max values when no elements have been recorded. Additionally, the change clarifies this behavior within the metric's protocol buffer definition, improving specification robustness.

Highlights

  • Metric Handling for Zero Count: Implemented a fix to correctly handle distribution metrics when the count of elements is zero, preventing potential issues with sum, min, and max values during aggregation.
  • Protocol Specification Clarification: Updated the protocol buffer specification (metrics.proto) with comments to explicitly state that sum, min, and max fields should be ignored by runners when a distribution metric's count is zero.
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 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 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

  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
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@shunping shunping force-pushed the prism-zerio-distribution-metric branch from f889e0d to 0141d58 Compare November 4, 2025 20:20
// - min: beam:coder:varint:v1
// - max: beam:coder:varint:v1
//
// Note that when count is zero, the SDK may or may not send sum, min, and
Copy link
Contributor

Choose a reason for hiding this comment

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

"may" in specs usually implies the conditional, so we can avoid the "or may not". I think "omit" here makes it clearer. Same for the paired paragraph below.

Suggested change
// Note that when count is zero, the SDK may or may not send sum, min, and
// Note that when count is zero, the SDK may omit sum, min, and

@shunping shunping merged commit 6d24c3d into apache:master Nov 5, 2025
156 of 168 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants