ArafatKhan2198 commented on code in PR #6801:
URL: https://github.com/apache/ozone/pull/6801#discussion_r1634396285
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/diskUsage/diskUsage.tsx:
##########
@@ -184,15 +186,19 @@ export class DiskUsage extends
React.Component<Record<string, object>, IDUState>
// Differentiate key without trailing slash
return (subpath.isKey || subpathName === OTHER_PATH_NAME) ?
subpathName : subpathName + '/';
});
-
+
values = subpaths.map(subpath => {
return subpath.size / dataSize;
});
-
+ // Logic for Values Normalization on Pie chart adding 0.05 so minimum
block
+ // will be displayed on Pie chart using below logic
+ // Percentage and Size string Logic will be same
+ normalizedValues= normalize(values);
+ normalizedValues= values && values.map((item)=> item+ 0.05);
Review Comment:
Represent 0.05 as a variable for example :-
```
const MIN_BLOCK_SIZE = 0.05; // Minimum block size for pie chart
normalization
```
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/diskUsage/diskUsage.tsx:
##########
@@ -184,15 +186,19 @@ export class DiskUsage extends
React.Component<Record<string, object>, IDUState>
// Differentiate key without trailing slash
return (subpath.isKey || subpathName === OTHER_PATH_NAME) ?
subpathName : subpathName + '/';
});
-
+
values = subpaths.map(subpath => {
return subpath.size / dataSize;
});
-
+ // Logic for Values Normalization on Pie chart adding 0.05 so minimum
block
+ // will be displayed on Pie chart using below logic
+ // Percentage and Size string Logic will be same
Review Comment:
Change the comment to the following :-
```suggestion
// Normalize values for the pie chart to ensure better visual
representation.
// Adding a small constant (MIN_BLOCK_SIZE) to each normalized value
ensures that even
// the smallest entities are visible on the pie chart.
// Note: The percentage and size string calculations remain unchanged.
```
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/diskUsage/diskUsage.tsx:
##########
@@ -184,15 +186,19 @@ export class DiskUsage extends
React.Component<Record<string, object>, IDUState>
// Differentiate key without trailing slash
return (subpath.isKey || subpathName === OTHER_PATH_NAME) ?
subpathName : subpathName + '/';
});
-
+
values = subpaths.map(subpath => {
return subpath.size / dataSize;
});
-
+ // Logic for Values Normalization on Pie chart adding 0.05 so minimum
block
+ // will be displayed on Pie chart using below logic
+ // Percentage and Size string Logic will be same
+ normalizedValues= normalize(values);
+ normalizedValues= values && values.map((item)=> item+ 0.05);
percentage = values.map(value => {
return (value * 100).toFixed(2);
});
-
+
Review Comment:
Please remove this change.
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/diskUsage/diskUsage.tsx:
##########
@@ -184,15 +186,19 @@ export class DiskUsage extends
React.Component<Record<string, object>, IDUState>
// Differentiate key without trailing slash
return (subpath.isKey || subpathName === OTHER_PATH_NAME) ?
subpathName : subpathName + '/';
});
-
+
Review Comment:
Please remove this change.
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/diskUsage/diskUsage.tsx:
##########
@@ -184,15 +186,19 @@ export class DiskUsage extends
React.Component<Record<string, object>, IDUState>
// Differentiate key without trailing slash
return (subpath.isKey || subpathName === OTHER_PATH_NAME) ?
subpathName : subpathName + '/';
});
-
+
values = subpaths.map(subpath => {
return subpath.size / dataSize;
});
-
+ // Logic for Values Normalization on Pie chart adding 0.05 so minimum
block
+ // will be displayed on Pie chart using below logic
+ // Percentage and Size string Logic will be same
+ normalizedValues= normalize(values);
Review Comment:
Please also test this out with Real Cluster data.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]