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

StatPanel: Fixes hanging issue when all values are zero #29077

Merged
merged 2 commits into from
Nov 13, 2020

Conversation

torkelo
Copy link
Member

@torkelo torkelo commented Nov 12, 2020

Fixes #29073

Apperently Number.MIN_VALUE is not what I thought. Stupid rookie mistake :(

This PR #28982 that fixed min max calculations when one series had zero made it so that max became Number.MIN_VALUE when all values are zero as zero is actually smaller than Number.MIN_VALUE. This max value made bizcharts change the browser.

This changes the logic so min & max remain null if all values are null.

@torkelo torkelo requested review from a team, mckn, kaydelaney and ryantxu and removed request for a team November 12, 2020 19:41
@torkelo torkelo added this to the 7.3.3 milestone Nov 12, 2020
@torkelo torkelo added old backport v7.3.x Mark PR to be automatically backported to v7.3.x type/bug add to changelog labels Nov 12, 2020
Copy link
Member

@ryantxu ryantxu left a comment

Choose a reason for hiding this comment

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

🤣 I saw the Number.MIN and wondered if that was really what you were after!

@torkelo torkelo merged commit 01a4951 into master Nov 13, 2020
@torkelo torkelo deleted the fix-min-max-calculations-again branch November 13, 2020 09:28
grafanabot pushed a commit that referenced this pull request Nov 13, 2020
* StatPanel: Fixes hanging issue when all values are zero

* Minor tweak

(cherry picked from commit 01a4951)
torkelo added a commit that referenced this pull request Nov 13, 2020
)

* StatPanel: Fixes hanging issue when all values are zero (#29077)

* StatPanel: Fixes hanging issue when all values are zero

* Minor tweak

(cherry picked from commit 01a4951)

* Fixed test

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
ryantxu pushed a commit that referenced this pull request Nov 18, 2020
* StatPanel: Fixes hanging issue when all values are zero

* Minor tweak
ryantxu pushed a commit that referenced this pull request Nov 18, 2020
* StatPanel: Fixes hanging issue when all values are zero

* Minor tweak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog old backport v7.3.x Mark PR to be automatically backported to v7.3.x type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stat panel type locks up browser when constant 0 value is returned in grafana 7.3.2
3 participants