Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare perf: Fix missing unit in grouped predicate entry #3987

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented Apr 3, 2025

Fixes a minor bug in the compare performance view, where the "ms" unit was not displayed on a grouped predicate entry.

Since the optional parameter unit is now provided at all call sites, and its absence was the cause of the bug, I also decided to make the parameter mandatory.

Before: missing unit

The unit was missing next to the first 2 in this screenshot:
Screenshot 2025-04-03 at 14 52 45

After: unit is there

(sorry, I didn't have the same query history item available for both screenshots)

Screenshot 2025-04-03 at 14 52 16

@Copilot Copilot bot review requested due to automatic review settings April 3, 2025 12:55
@asgerf asgerf requested a review from a team as a code owner April 3, 2025 12:55
Copy link

@Copilot Copilot AI left a comment

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 addresses a bug in the compare performance view where the unit (e.g. "ms") was missing for grouped predicate entries. The changes update the function signature and its calls to ensure that the unit is provided.

  • Updated renderOptionalValue signature to reflect the expected unit parameter.
  • Modified calls to renderOptionalValue to supply the unit from metric.unit.

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

@@ -81,7 +81,7 @@ class ComparisonDataset {
}
}

function renderOptionalValue(x: Optional<number>, unit?: string) {
function renderOptionalValue(x: Optional<number>, unit: string | undefined) {
Copy link
Preview

Copilot AI Apr 3, 2025

Choose a reason for hiding this comment

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

If the 'unit' parameter is intended to be mandatory as mentioned in the PR description, consider updating its type to 'string' instead of 'string | undefined' and ensure that all call sites provide a valid string.

Suggested change
function renderOptionalValue(x: Optional<number>, unit: string | undefined) {
function renderOptionalValue(x: Optional<number>, unit: string) {

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Copy link
Member

@koesie10 koesie10 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants