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

   
   ## What changes were proposed in this pull request?
   It would be better to not use netty internal `maxDirectMemory` and 
`usedDirectMemory` in NettyMetrics#getMetrics.
   
   `usedDirectMemory` can be replaced by netty public api. For example:
   ```
   public long getUsedDirectMemory() {
   ByteBufAllocator allocator = ByteBufAllocator.DEFAULT;
   if (allocator instanceof ByteBufAllocatorMetricProvider)
   
   { ByteBufAllocatorMetric metric = ((ByteBufAllocatorMetricProvider) 
allocator).metric(); return metric.usedDirectMemory(); }
   
   return -1L;
   }
   ```
   
   `maxDirectMemory` depends on system property and jvm setting.
   
   ## What is the link to the Apache JIRA
   
    https://issues.apache.org/jira/browse/HDDS-15931
   
   ## How was this patch tested?
   
   https://github.com/rich7420/ozone/actions/runs/29946173218


-- 
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]

Reply via email to