You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "smitajoshi12 (via GitHub)" <gi...@apache.org> on 2023/05/05 14:41:09 UTC

[GitHub] [ozone] smitajoshi12 opened a new pull request, #4665: HDDS-7812. Recon UI: Add visualization for container size distribution

smitajoshi12 opened a new pull request, #4665:
URL: https://github.com/apache/ozone/pull/4665

   ## What changes were proposed in this pull request?
   Recon has an API endpoint to get container size distribution in Ozone. Add visualisation in Recon UI for this using histograms.
   We will have to add another box that will display the percentages
    Example
       {      
        "containerSize": 1024,       
         "count": 2     
       },
       {
         "containerSize": 16384,
         "count": 3
       },
       {
         "containerSize": 2097152,
         "count": 4
       },
       {
         "containerSize": 11270,
         "count": 5
       }
   
   Total Count ➖ 2+3+4+5 = *14 Total Containers*
   Percentage of Containers having upperbound 1024 = 2/14 *100 = 14.28%
   Percentage of Containers having upperbound 16384 = 3/14 *100 = 21.42%
   Percentage of Containers having upperbound 2097152 = 4/14 *100 = 28.5%
   Percentage of Containers having upperbound 11270 = 5/14 *100 = 35.7%
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-7812
   
   ## How was this patch tested?
   Manually
   ![image](https://user-images.githubusercontent.com/112169209/236488950-4be58c98-22a2-49d7-963b-998c7abb25db.png)
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smitajoshi12 commented on pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on PR #4665:
URL: https://github.com/apache/ozone/pull/4665#issuecomment-1537735666

   @ArafatKhan2198  These are latest changes of patch.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] ArafatKhan2198 commented on pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "ArafatKhan2198 (via GitHub)" <gi...@apache.org>.
ArafatKhan2198 commented on PR #4665:
URL: https://github.com/apache/ozone/pull/4665#issuecomment-1559145205

   Please ensure that the text color is white for those specific colors where it currently appears as black.
   
   <img width="183" alt="image" src="https://github.com/apache/ozone/assets/98023601/a22f7366-9770-4431-9808-f895c27c961c">
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smitajoshi12 commented on a diff in pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on code in PR #4665:
URL: https://github.com/apache/ozone/pull/4665#discussion_r1194856811


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -155,12 +165,45 @@ export class Insights extends React.Component<Record<string, object>, IInsightsS
         const lowerbound = upperboundPower > 10 ? size(2 ** (upperboundPower - 1)) : size(0);
         return `${lowerbound} - ${upperbound}`;
       });
+      
+      const xyConatainerCountMap: Map<number, number> = containerCountResponse.reduce(
+        (map: Map<number, number>, current) => {
+          const fileSize = current.containerSize;
+          const oldCount = map.has(fileSize) ? map.get(fileSize)! : 0;
+          map.set(fileSize, oldCount + current.count);
+          return map;
+        }, new Map<number, number>());
+      // Calculate the previous power of 2 to find the lower bound of the range
+      // Ex: for 2048, the lower bound is 1024
+      const xContainerCountValues = Array.from(xyConatainerCountMap.keys()).map(value => {
+        const upperbound = size(value);
+        const upperboundPower = Math.log2(value);
+        // For 1024 which is 2^10, the lowerbound is 0, since we start binning
+        // after 2^10
+        const lowerbound = upperboundPower > 10 ? size(2 ** (upperboundPower - 1)) : size(0);
+        return `${lowerbound} - ${upperbound}`;
+      });
+
+      let keysize = [];
+      keysize = Array.from(xyConatainerCountMap.keys()).map(value => {
+        return (size(value) );
+      });
+
       this.setState({
         plotData: [{
           type: 'bar',
           x: xValues,

Review Comment:
   @dombizita 
   Completed Change Suggested by you.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smitajoshi12 commented on a diff in pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on code in PR #4665:
URL: https://github.com/apache/ozone/pull/4665#discussion_r1194855741


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -36,10 +37,17 @@ interface IFileCountResponse {
   count: number;
 }
 
+interface IContainerCountResponse {
+  containerSize: number;
+  count: number;
+}
+
 interface IInsightsState {
   isLoading: boolean;
   fileCountsResponse: IFileCountResponse[];
+  containerCountResponse: IContainerCountResponse[];
   plotData: Plotly.Data[];
+  containerData: Plotly.Data[];

Review Comment:
   @dombizita 
   Completed Change Suggested by you.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] ArafatKhan2198 commented on pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "ArafatKhan2198 (via GitHub)" <gi...@apache.org>.
ArafatKhan2198 commented on PR #4665:
URL: https://github.com/apache/ozone/pull/4665#issuecomment-1539597989

   
   @smitajoshi12 These screenshots indicate that the size of some containers is less than 512 MB, which is not possible according to the backend. To address this, I implemented changes to the backend that group all containers with sizes smaller than 512 MB into the range of 0-512 MB. Please pull in the latest changes and populate a local ozone cluster with data and take scereenshots of those. 
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smitajoshi12 commented on pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on PR #4665:
URL: https://github.com/apache/ozone/pull/4665#issuecomment-1560945384

   > Please ensure that the text color is white for those specific colors where it currently appears as black.
   > 
   > <img alt="image" width="183" src="https://user-images.githubusercontent.com/98023601/240266391-a22f7366-9770-4431-9808-f895c27c961c.png">
   
   @ArafatKhan2198 
   In Disk Usage it is internally manged by library we could not modify color of tool-tip as per background color it will vary.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] ArafatKhan2198 commented on pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "ArafatKhan2198 (via GitHub)" <gi...@apache.org>.
ArafatKhan2198 commented on PR #4665:
URL: https://github.com/apache/ozone/pull/4665#issuecomment-1559143398

   Can you please make the allingment proper, the some of the letters get hidden :-
   <img width="175" alt="image" src="https://github.com/apache/ozone/assets/98023601/5a8958a7-a6f0-46ce-b212-00ec03aa7f0a">
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] dombizita commented on a diff in pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "dombizita (via GitHub)" <gi...@apache.org>.
dombizita commented on code in PR #4665:
URL: https://github.com/apache/ozone/pull/4665#discussion_r1194012239


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -36,10 +37,17 @@ interface IFileCountResponse {
   count: number;
 }
 
+interface IContainerCountResponse {
+  containerSize: number;
+  count: number;
+}
+
 interface IInsightsState {
   isLoading: boolean;
   fileCountsResponse: IFileCountResponse[];
+  containerCountResponse: IContainerCountResponse[];
   plotData: Plotly.Data[];
+  containerData: Plotly.Data[];

Review Comment:
   as we are having both container and file count size task now, we should rename the previous variable, so it is easier to understand it. 
   ```suggestion
     fileCountData: Plotly.Data[];
     containerCountData: Plotly.Data[];
   ```



##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -155,12 +165,45 @@ export class Insights extends React.Component<Record<string, object>, IInsightsS
         const lowerbound = upperboundPower > 10 ? size(2 ** (upperboundPower - 1)) : size(0);
         return `${lowerbound} - ${upperbound}`;
       });
+      
+      const xyConatainerCountMap: Map<number, number> = containerCountResponse.reduce(

Review Comment:
   ```suggestion
         const xyContainerCountMap: Map<number, number> = containerCountResponse.reduce(
   ```



##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -155,12 +165,45 @@ export class Insights extends React.Component<Record<string, object>, IInsightsS
         const lowerbound = upperboundPower > 10 ? size(2 ** (upperboundPower - 1)) : size(0);
         return `${lowerbound} - ${upperbound}`;
       });
+      
+      const xyConatainerCountMap: Map<number, number> = containerCountResponse.reduce(
+        (map: Map<number, number>, current) => {
+          const fileSize = current.containerSize;
+          const oldCount = map.has(fileSize) ? map.get(fileSize)! : 0;
+          map.set(fileSize, oldCount + current.count);
+          return map;
+        }, new Map<number, number>());
+      // Calculate the previous power of 2 to find the lower bound of the range
+      // Ex: for 2048, the lower bound is 1024
+      const xContainerCountValues = Array.from(xyConatainerCountMap.keys()).map(value => {
+        const upperbound = size(value);
+        const upperboundPower = Math.log2(value);
+        // For 1024 which is 2^10, the lowerbound is 0, since we start binning
+        // after 2^10
+        const lowerbound = upperboundPower > 10 ? size(2 ** (upperboundPower - 1)) : size(0);
+        return `${lowerbound} - ${upperbound}`;
+      });
+
+      let keysize = [];
+      keysize = Array.from(xyConatainerCountMap.keys()).map(value => {
+        return (size(value) );
+      });
+
       this.setState({
         plotData: [{
           type: 'bar',
           x: xValues,
           y: Array.from(xyMap.values()),

Review Comment:
   ```suggestion
             y: Array.from(xyFileCountMap.values()),
   ```



##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -215,69 +264,107 @@ export class Insights extends React.Component<Record<string, object>, IInsightsS
 
   render() {
     const {plotData, isLoading, selectedBuckets, volumeOptions,
-      selectedVolumes, fileCountsResponse, bucketOptions, isBucketSelectionDisabled} = this.state;
+      selectedVolumes, fileCountsResponse, bucketOptions, isBucketSelectionDisabled, containerCountResponse, containerData} = this.state;
     return (
       <div className='insights-container'>
         <div className='page-header'>
           Insights
         </div>
+       
         <div className='content-div'>
-          {isLoading ? <span><Icon type='loading'/> Loading...</span> :
-            ((fileCountsResponse && fileCountsResponse.length > 0) ?
-              <div>
-                <Row>
-                  <Col xs={24} xl={18}>
-                    <Row>
-                      <Col>
-                        <div className='filter-block'>
-                          <h4>Volumes</h4>
-                          <MultiSelect
-                            allowSelectAll
-                            isMulti
-                            className='multi-select-container'
-                            options={volumeOptions}
-                            closeMenuOnSelect={false}
-                            hideSelectedOptions={false}
-                            value={selectedVolumes}
-                            allOption={allVolumesOption}
-                            onChange={this.handleVolumeChange}
-                          />
-                        </div>
-                        <div className='filter-block'>
-                          <h4>Buckets</h4>
-                          <MultiSelect
-                            allowSelectAll
-                            isMulti
-                            className='multi-select-container'
-                            options={bucketOptions}
-                            closeMenuOnSelect={false}
-                            hideSelectedOptions={false}
-                            value={selectedBuckets}
-                            allOption={allBucketsOption}
-                            isDisabled={isBucketSelectionDisabled}
-                            onChange={this.handleBucketChange}
-                          />
-                        </div>
-                      </Col>
-                    </Row>
-                  </Col>
-                </Row>
-                <Row>
-                  <Col>
-                    <Plot
-                      data={plotData}
-                      layout={
-                        {
-                          width: 800,
-                          height: 600,
-                          title: 'File Size Distribution',
-                          showlegend: true
-                        }
-                      }/>
-                  </Col>
-                </Row>
-              </div> :
-              <div>No data to visualize file size distribution. Add files to Ozone to see a visualization on file size distribution.</div>)}
+          <Tabs defaultActiveKey='1'>
+            <TabPane key='1' tab={`File Size`}>
+              {
+                <div className='content-div'>
+                  {isLoading ? <span><Icon type='loading'/> Loading...</span> :
+                    ((fileCountsResponse && fileCountsResponse.length > 0) ?
+                      <div>
+                        <Row>
+                          <Col xs={24} xl={18}>
+                            <Row>
+                              <Col>
+                                <div className='filter-block'>
+                                  <h4>Volumes</h4>
+                                  <MultiSelect
+                                    allowSelectAll
+                                    isMulti
+                                    className='multi-select-container'
+                                    options={volumeOptions}
+                                    closeMenuOnSelect={false}
+                                    hideSelectedOptions={false}
+                                    value={selectedVolumes}
+                                    allOption={allVolumesOption}
+                                    onChange={this.handleVolumeChange}
+                                  />
+                                </div>
+                                <div className='filter-block'>
+                                  <h4>Buckets</h4>
+                                  <MultiSelect
+                                    allowSelectAll
+                                    isMulti
+                                    className='multi-select-container'
+                                    options={bucketOptions}
+                                    closeMenuOnSelect={false}
+                                    hideSelectedOptions={false}
+                                    value={selectedBuckets}
+                                    allOption={allBucketsOption}
+                                    isDisabled={isBucketSelectionDisabled}
+                                    onChange={this.handleBucketChange}
+                                  />
+                                </div>
+                              </Col>
+                            </Row>
+                          </Col>
+                        </Row>
+                        <Row>
+                          <Col>
+                            <Plot
+                              data={plotData}
+                              layout={
+                                {
+                                  width: 800,
+                                  height: 600,
+                                  title: 'File Size Distribution',
+                                  showlegend: false
+                                }
+                              } />
+                          </Col>
+                        </Row>
+                      </div> :
+                      <div>No data to visualize file size distribution. Add files to Ozone to see a visualization on file size distribution.</div>)}
+                </div>
+              }
+            </TabPane>
+            <TabPane key='2' tab={`Container Size`}>
+              {
+                <div className='content-div'>
+                  {isLoading ? <span><Icon type='loading'/> Loading...</span> :
+                    ((containerCountResponse && containerCountResponse.length > 0) ?
+                      <div>
+                        <Row>
+                          <Col>
+                            <Plot
+                              data={containerData}
+                              layout={
+                                {
+                                  width: 850,
+                                  height: 750,
+                                  font: {
+                                    family: 'Roboto, sans-serif',
+                                    size: 15
+                                  },
+                                  title: 'Container Size Distribution',
+                                  showlegend: true
+                                }
+                              }/>
+                          </Col>
+                        </Row>
+                      </div> :
+                      <div>No data to visualize Container size distribution. Add files to Ozone to see a visualization on Container size distribution.</div>)}

Review Comment:
   ```suggestion
                         <div>No data to visualize container size distribution. Add files to Ozone to see a visualization on container size distribution.</div>)}
   ```



##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -155,12 +165,45 @@ export class Insights extends React.Component<Record<string, object>, IInsightsS
         const lowerbound = upperboundPower > 10 ? size(2 ** (upperboundPower - 1)) : size(0);
         return `${lowerbound} - ${upperbound}`;
       });
+      
+      const xyConatainerCountMap: Map<number, number> = containerCountResponse.reduce(
+        (map: Map<number, number>, current) => {
+          const fileSize = current.containerSize;
+          const oldCount = map.has(fileSize) ? map.get(fileSize)! : 0;
+          map.set(fileSize, oldCount + current.count);
+          return map;
+        }, new Map<number, number>());
+      // Calculate the previous power of 2 to find the lower bound of the range
+      // Ex: for 2048, the lower bound is 1024
+      const xContainerCountValues = Array.from(xyConatainerCountMap.keys()).map(value => {
+        const upperbound = size(value);
+        const upperboundPower = Math.log2(value);
+        // For 1024 which is 2^10, the lowerbound is 0, since we start binning
+        // after 2^10
+        const lowerbound = upperboundPower > 10 ? size(2 ** (upperboundPower - 1)) : size(0);
+        return `${lowerbound} - ${upperbound}`;
+      });
+
+      let keysize = [];
+      keysize = Array.from(xyConatainerCountMap.keys()).map(value => {
+        return (size(value) );
+      });
+
       this.setState({
         plotData: [{
           type: 'bar',
           x: xValues,

Review Comment:
   ```suggestion
             x: xFileCountValues,
   ```



##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -155,12 +165,45 @@ export class Insights extends React.Component<Record<string, object>, IInsightsS
         const lowerbound = upperboundPower > 10 ? size(2 ** (upperboundPower - 1)) : size(0);
         return `${lowerbound} - ${upperbound}`;
       });
+      
+      const xyConatainerCountMap: Map<number, number> = containerCountResponse.reduce(
+        (map: Map<number, number>, current) => {
+          const fileSize = current.containerSize;

Review Comment:
   ```suggestion
             const containerSize = current.containerSize;
   ```



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] dombizita commented on pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "dombizita (via GitHub)" <gi...@apache.org>.
dombizita commented on PR #4665:
URL: https://github.com/apache/ozone/pull/4665#issuecomment-1559117795

   can you also review this patch @ArafatKhan2198?


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smitajoshi12 commented on pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on PR #4665:
URL: https://github.com/apache/ozone/pull/4665#issuecomment-1543348934

   > @smitajoshi12 These screenshots indicate that the size of some containers is less than 512 MB, which is not possible according to the backend. To address this, I implemented changes to the backend that group all containers with sizes smaller than 512 MB into the range of 0-512 MB. Please pull in the latest changes and populate a local ozone cluster with data and take scereenshots of those.
   
   @ArafatKhan2198 
   Added new screenshots.
   
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smitajoshi12 commented on a diff in pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on code in PR #4665:
URL: https://github.com/apache/ozone/pull/4665#discussion_r1194856111


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -155,12 +165,45 @@ export class Insights extends React.Component<Record<string, object>, IInsightsS
         const lowerbound = upperboundPower > 10 ? size(2 ** (upperboundPower - 1)) : size(0);
         return `${lowerbound} - ${upperbound}`;
       });
+      
+      const xyConatainerCountMap: Map<number, number> = containerCountResponse.reduce(

Review Comment:
   @dombizita 
   Completed Change Suggested by youu in latest commit.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] ArafatKhan2198 commented on pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "ArafatKhan2198 (via GitHub)" <gi...@apache.org>.
ArafatKhan2198 commented on PR #4665:
URL: https://github.com/apache/ozone/pull/4665#issuecomment-1559146737

   Change the message to ➖ ”No data available for container size distribution visualization. Add files to Ozone.”
   which sounds more simple and short
   
   <img width="1651" alt="image" src="https://github.com/apache/ozone/assets/98023601/72ce083d-ff71-40f0-9b5f-b280ec7fe8d4">
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smitajoshi12 commented on pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on PR #4665:
URL: https://github.com/apache/ozone/pull/4665#issuecomment-1560938229

   > Change the message to heavy_minus_sign ”No data available for container size distribution visualization. Add files to Ozone.” which sounds more simple and short
   > 
   > <img alt="image" width="1651" src="https://user-images.githubusercontent.com/98023601/240267055-72ce083d-ff71-40f0-9b5f-b280ec7fe8d4.png">
   
   
   
   > Can you please make the alinement proper, some of the letters get hidden :- <img alt="image" width="175" src="https://user-images.githubusercontent.com/98023601/240265824-5a8958a7-a6f0-46ce-b212-00ec03aa7f0a.png">
   
   Completed Changes Suggested by Arafat.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smitajoshi12 commented on a diff in pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on code in PR #4665:
URL: https://github.com/apache/ozone/pull/4665#discussion_r1194857080


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -215,69 +264,107 @@ export class Insights extends React.Component<Record<string, object>, IInsightsS
 
   render() {
     const {plotData, isLoading, selectedBuckets, volumeOptions,
-      selectedVolumes, fileCountsResponse, bucketOptions, isBucketSelectionDisabled} = this.state;
+      selectedVolumes, fileCountsResponse, bucketOptions, isBucketSelectionDisabled, containerCountResponse, containerData} = this.state;
     return (
       <div className='insights-container'>
         <div className='page-header'>
           Insights
         </div>
+       
         <div className='content-div'>
-          {isLoading ? <span><Icon type='loading'/> Loading...</span> :
-            ((fileCountsResponse && fileCountsResponse.length > 0) ?
-              <div>
-                <Row>
-                  <Col xs={24} xl={18}>
-                    <Row>
-                      <Col>
-                        <div className='filter-block'>
-                          <h4>Volumes</h4>
-                          <MultiSelect
-                            allowSelectAll
-                            isMulti
-                            className='multi-select-container'
-                            options={volumeOptions}
-                            closeMenuOnSelect={false}
-                            hideSelectedOptions={false}
-                            value={selectedVolumes}
-                            allOption={allVolumesOption}
-                            onChange={this.handleVolumeChange}
-                          />
-                        </div>
-                        <div className='filter-block'>
-                          <h4>Buckets</h4>
-                          <MultiSelect
-                            allowSelectAll
-                            isMulti
-                            className='multi-select-container'
-                            options={bucketOptions}
-                            closeMenuOnSelect={false}
-                            hideSelectedOptions={false}
-                            value={selectedBuckets}
-                            allOption={allBucketsOption}
-                            isDisabled={isBucketSelectionDisabled}
-                            onChange={this.handleBucketChange}
-                          />
-                        </div>
-                      </Col>
-                    </Row>
-                  </Col>
-                </Row>
-                <Row>
-                  <Col>
-                    <Plot
-                      data={plotData}
-                      layout={
-                        {
-                          width: 800,
-                          height: 600,
-                          title: 'File Size Distribution',
-                          showlegend: true
-                        }
-                      }/>
-                  </Col>
-                </Row>
-              </div> :
-              <div>No data to visualize file size distribution. Add files to Ozone to see a visualization on file size distribution.</div>)}
+          <Tabs defaultActiveKey='1'>
+            <TabPane key='1' tab={`File Size`}>
+              {
+                <div className='content-div'>
+                  {isLoading ? <span><Icon type='loading'/> Loading...</span> :
+                    ((fileCountsResponse && fileCountsResponse.length > 0) ?
+                      <div>
+                        <Row>
+                          <Col xs={24} xl={18}>
+                            <Row>
+                              <Col>
+                                <div className='filter-block'>
+                                  <h4>Volumes</h4>
+                                  <MultiSelect
+                                    allowSelectAll
+                                    isMulti
+                                    className='multi-select-container'
+                                    options={volumeOptions}
+                                    closeMenuOnSelect={false}
+                                    hideSelectedOptions={false}
+                                    value={selectedVolumes}
+                                    allOption={allVolumesOption}
+                                    onChange={this.handleVolumeChange}
+                                  />
+                                </div>
+                                <div className='filter-block'>
+                                  <h4>Buckets</h4>
+                                  <MultiSelect
+                                    allowSelectAll
+                                    isMulti
+                                    className='multi-select-container'
+                                    options={bucketOptions}
+                                    closeMenuOnSelect={false}
+                                    hideSelectedOptions={false}
+                                    value={selectedBuckets}
+                                    allOption={allBucketsOption}
+                                    isDisabled={isBucketSelectionDisabled}
+                                    onChange={this.handleBucketChange}
+                                  />
+                                </div>
+                              </Col>
+                            </Row>
+                          </Col>
+                        </Row>
+                        <Row>
+                          <Col>
+                            <Plot
+                              data={plotData}
+                              layout={
+                                {
+                                  width: 800,
+                                  height: 600,
+                                  title: 'File Size Distribution',
+                                  showlegend: false
+                                }
+                              } />
+                          </Col>
+                        </Row>
+                      </div> :
+                      <div>No data to visualize file size distribution. Add files to Ozone to see a visualization on file size distribution.</div>)}
+                </div>
+              }
+            </TabPane>
+            <TabPane key='2' tab={`Container Size`}>
+              {
+                <div className='content-div'>
+                  {isLoading ? <span><Icon type='loading'/> Loading...</span> :
+                    ((containerCountResponse && containerCountResponse.length > 0) ?
+                      <div>
+                        <Row>
+                          <Col>
+                            <Plot
+                              data={containerData}
+                              layout={
+                                {
+                                  width: 850,
+                                  height: 750,
+                                  font: {
+                                    family: 'Roboto, sans-serif',
+                                    size: 15
+                                  },
+                                  title: 'Container Size Distribution',
+                                  showlegend: true
+                                }
+                              }/>
+                          </Col>
+                        </Row>
+                      </div> :
+                      <div>No data to visualize Container size distribution. Add files to Ozone to see a visualization on Container size distribution.</div>)}

Review Comment:
   @dombizita 
   Completed Change Suggested by you.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on PR #4665:
URL: https://github.com/apache/ozone/pull/4665#issuecomment-1570674252

   Thanks @smitajoshi12 for the patch. Thanks @dombizita for reviewing this.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl merged pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl merged PR #4665:
URL: https://github.com/apache/ozone/pull/4665


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smitajoshi12 commented on a diff in pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on code in PR #4665:
URL: https://github.com/apache/ozone/pull/4665#discussion_r1194856476


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -155,12 +165,45 @@ export class Insights extends React.Component<Record<string, object>, IInsightsS
         const lowerbound = upperboundPower > 10 ? size(2 ** (upperboundPower - 1)) : size(0);
         return `${lowerbound} - ${upperbound}`;
       });
+      
+      const xyConatainerCountMap: Map<number, number> = containerCountResponse.reduce(
+        (map: Map<number, number>, current) => {
+          const fileSize = current.containerSize;

Review Comment:
   @dombizita 
   Completed Change Suggested by you.



##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -155,12 +165,45 @@ export class Insights extends React.Component<Record<string, object>, IInsightsS
         const lowerbound = upperboundPower > 10 ? size(2 ** (upperboundPower - 1)) : size(0);
         return `${lowerbound} - ${upperbound}`;
       });
+      
+      const xyConatainerCountMap: Map<number, number> = containerCountResponse.reduce(
+        (map: Map<number, number>, current) => {
+          const fileSize = current.containerSize;
+          const oldCount = map.has(fileSize) ? map.get(fileSize)! : 0;
+          map.set(fileSize, oldCount + current.count);
+          return map;
+        }, new Map<number, number>());
+      // Calculate the previous power of 2 to find the lower bound of the range
+      // Ex: for 2048, the lower bound is 1024
+      const xContainerCountValues = Array.from(xyConatainerCountMap.keys()).map(value => {
+        const upperbound = size(value);
+        const upperboundPower = Math.log2(value);
+        // For 1024 which is 2^10, the lowerbound is 0, since we start binning
+        // after 2^10
+        const lowerbound = upperboundPower > 10 ? size(2 ** (upperboundPower - 1)) : size(0);
+        return `${lowerbound} - ${upperbound}`;
+      });
+
+      let keysize = [];
+      keysize = Array.from(xyConatainerCountMap.keys()).map(value => {
+        return (size(value) );
+      });
+
       this.setState({
         plotData: [{
           type: 'bar',
           x: xValues,
           y: Array.from(xyMap.values()),

Review Comment:
   @dombizita 
   Completed Change Suggested by you.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] ArafatKhan2198 commented on pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "ArafatKhan2198 (via GitHub)" <gi...@apache.org>.
ArafatKhan2198 commented on PR #4665:
URL: https://github.com/apache/ozone/pull/4665#issuecomment-1537064098

   @smitajoshi12 Can you please add the screenshot of the latest Pie Chart that we had discussed !!


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smitajoshi12 commented on pull request #4665: HDDS-7812. Recon UI: Add visualization for container size distribution.

Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on PR #4665:
URL: https://github.com/apache/ozone/pull/4665#issuecomment-1560938863

   > Change the message to heavy_minus_sign ”No data available for container size distribution visualization. Add files to Ozone.” which sounds more simple and short
   > 
   > <img alt="image" width="1651" src="https://user-images.githubusercontent.com/98023601/240267055-72ce083d-ff71-40f0-9b5f-b280ec7fe8d4.png">
   
   Completed Changes Suggested by Arafat.
   
   ![image](https://github.com/apache/ozone/assets/112169209/2c495c3c-336e-4a0e-ab44-3630a247037d)
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org