HDDS-14827. Sync chart labels with sorted filesize data - insightsFilePlot#9912
Open
arunsarin85 wants to merge 2 commits intoapache:masterfrom
Open
HDDS-14827. Sync chart labels with sorted filesize data - insightsFilePlot#9912arunsarin85 wants to merge 2 commits intoapache:masterfrom
arunsarin85 wants to merge 2 commits intoapache:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
HDDS-14827. Sync chart labels with sorted filesize data - insightsFilePlot
Please describe your PR in detail:
The bug is a label-value misalignment in the frontend chart rendering, introduced when the sorting step was added to the v2 insightsFilePlot.tsx component.
In updatePlotData(), the code did three things in this order:
ECharts then wired:
These two arrays are in different orders, so each label gets the wrong bar height. When the API starts returning 100 GiB entries before smaller entries (which happens around 2500+ files, as the large bucket becomes dominant in the RocksDB iterator scan), the "64 GiB – 128 GiB" label ends up at index 0 while ECharts renders the small-file count at index 0 - and the tall bar for 100 GiB files gets the "512 KiB – 1 MiB" label.
Fix
In both insightsFilePlot.tsx (v2) and insights.tsx (legacy), the map is now sorted first, and only then are the x-axis labels computed - ensuring labels and bar values are always derived from the same ordered sequence.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14827
How was this patch tested?
Locally:
Pre-requisites : Added the dummy data in db.json