[ 
https://issues.apache.org/jira/browse/HDDS-15931?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated HDDS-15931:
----------------------------------
    Labels: pull-request-available  (was: )

> Remove usage of internal netty metrics
> --------------------------------------
>
>                 Key: HDDS-15931
>                 URL: https://issues.apache.org/jira/browse/HDDS-15931
>             Project: Apache Ozone
>          Issue Type: Sub-task
>            Reporter: Chung-En Lee
>            Assignee: Huang Kuan Hao
>            Priority: Major
>              Labels: pull-request-available
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to