[ 
https://issues.apache.org/jira/browse/FLINK-15314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17048768#comment-17048768
 ] 

lining commented on FLINK-15314:
--------------------------------

Hi [~gjy] , I encountered a specific problem: If some developers make changes 
to the metrics in the place where these metrics are defined(ps: in 
MetricUtils). But it forgot to update code in the link; the rest API will get 
the wrong information. If we define these keys in MetricUtils, rest API call 
MetricUtils.xxx to get the key. Then we only need to maintain them in one place.

> To refactor duplicated code in 
> TaskManagerDetailsHandler#createTaskManagerMetricsInfo
> -------------------------------------------------------------------------------------
>
>                 Key: FLINK-15314
>                 URL: https://issues.apache.org/jira/browse/FLINK-15314
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / Metrics, Runtime / REST
>            Reporter: lining
>            Priority: Major
>
> As 
> [code|https://github.com/apache/flink/blob/master/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/taskmanager/TaskManagerDetailsHandler.java#L119-L142]
>  show,  use hard codes to define metrics' name. Could we unify where to 
> register and get metrics? 
>  * propose
>  ** move  metrics'name define in MetricUtils to MetricNames
>  ** the all get the name form MetricNames



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to