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

ASF GitHub Bot commented on FLINK-4772:
---------------------------------------

GitHub user zentol opened a pull request:

    https://github.com/apache/flink/pull/2615

    [FLINK-4772] [FLINK-4775] Metric Store enhancements

    This PR changes a few things about the MetricStore class to make it easier 
to work with.
    
    * metrics are now stored as strings (Map<String, Object> => Map<String, 
String>) since the differentiation only leads to cumbersome casts.
    * sub-structures are no longer accessed directly but through helper 
methods. This allows traversing several layers with a single call.
    * finally, a simple getMetric(name, defaultValue) was added to easier 
handle metrics that weren't updated yet (and potentially never will) and thus 
would return null

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zentol/flink 4772_4775_metric_store

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/2615.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2615
    
----
commit a350abb5a16b35a11664f254574f6b192c6dca83
Author: zentol <[email protected]>
Date:   2016-10-07T08:11:31Z

    [FLINK-4772] [metrics] Store metrics as strings in MetricStore

commit b9940c15bed2cb4fbe92be259826fa4ab560f629
Author: zentol <[email protected]>
Date:   2016-10-07T08:16:49Z

    [FLINK-4775] [metrics] Simplify MetricStore access

----


> Store metrics in MetricStore as strings
> ---------------------------------------
>
>                 Key: FLINK-4772
>                 URL: https://issues.apache.org/jira/browse/FLINK-4772
>             Project: Flink
>          Issue Type: Improvement
>          Components: Metrics, Webfrontend
>    Affects Versions: 1.1.2
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>             Fix For: 1.2.0
>
>
> The MetricStore is a nested structure which stores metrics in several 
> Map<String, Object> objects. The key is the name of the metric, while the 
> value is the value of the metric. Since gauges are transmitted as Strings, 
> and all other metric types are of numeric nature, the type of the value is 
> limited to Strings and Numbers.
> Storing them with different types however has no benefit, and makes working 
> with the MetricStore needlessly complicated since one is forced to cast every 
> retrieved metric. This also implies that one either has to know what kind of 
> metric you're dealing with (which can easily go wrong), or check the type 
> before using the metric, which is cumbersome.
> As such i propose storing all metrics as strings.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to