-
Notifications
You must be signed in to change notification settings - Fork 123
Fix UI Query Distribution chart showing zero queries inaccurately #788
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
base: main
Are you sure you want to change the base?
Fix UI Query Distribution chart showing zero queries inaccurately #788
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Peiying Ye.
|
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReplaces float-based parsing of minute buckets with BigDecimal to fix incorrect zero query counts in the Query Distribution chart by preserving full precision during conversion. Class diagram for updated minute parsing in HaQueryHistoryManagerclassDiagram
class HaQueryHistoryManager {
+List<DistributionResponse.LineChart> findDistribution(Long ts)
}
class DistributionResponse {
}
class LineChart {
}
HaQueryHistoryManager --> DistributionResponse : uses
DistributionResponse --> LineChart : contains
HaQueryHistoryManager : - minute parsing changed from Float.parseFloat to BigDecimal.longValue
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
64445d3 to
b12e7ef
Compare
|
Verified that the fix works. Can we add a test case? |
maswin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Can you rebase, squash commits into one, follow commit message guideline?
4f0f6a7 to
601c051
Compare
601c051 to
3a5bd1c
Compare
Description
The Trino Gateway UI currently has a bug in the Query Distribution chart: query counts display correctly for even minutes, but always show zero for odd minutes due to the incorrect query count calculation.
The issue is caused by using
Float.parseFloatwhen converting the minute value. Since float has limited precision, the last bit of the value was lost, results wrong minute buckets. This PR replacesFloat.parseFloatwithBigDecimal longvalueto ensure full precision and correct query counts for all minutes.Testing Done
mvn clean installAdditional context and related issues
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required, with the following suggested text:
* Fix UI Query Distribution chart showing zero queries inaccurately.Summary by Sourcery
Bug Fixes: