You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by zentol <gi...@git.apache.org> on 2017/11/01 13:20:53 UTC

[GitHub] flink pull request #4932: [FLINK-7958][metrics] Allow reporters to define de...

GitHub user zentol opened a pull request:

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

    [FLINK-7958][metrics] Allow reporters to define default delimiter

    ## What is the purpose of the change
    
    This PR allows reporters to define their default delimiter. Previously we always defaulted to `.`.
    
    Reporters may now implement the `DelimiterProvider` interface with which they may define a delimiter. This delimiter is used if no delimiter was explicitly configured for the reporter.
    
    ## Brief change log
    
    * Add DelimiterProvider interface
    * modify Prometheus&JmxReporter to define the default delimiter
    * modify delimiter setup in the MetricRegistry
    * add a test to the MetricRegistryTest to verify functionality
    
    ## Verifying this change
    
    This change added tests and can be verified as follows:
    
    Run MetricRegistryTest#testDelimiterOverride.
    
    ## Does this pull request potentially affect one of the following parts:
    
      - Dependencies (does it add or upgrade a dependency): ( no)
      - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: ( no)
      - The serializers: (no)
      - The runtime per-record code paths (performance sensitive): (no)
      - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
    
    ## Documentation
    
      - Does this pull request introduce a new feature? (no)
      - If yes, how is the feature documented? (not applicable)
    


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

    $ git pull https://github.com/zentol/flink 7958

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

    https://github.com/apache/flink/pull/4932.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 #4932
    
----
commit 5286a1d89b71aa00252e2217f20e08352e120257
Author: zentol <ch...@apache.org>
Date:   2017-11-01T13:08:02Z

    [FLINK-7958][metrics] Allow reporters to define default delimiter

----


---

[GitHub] flink issue #4932: [FLINK-7958][metrics] Allow reporters to define default d...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/4932
  
    I would stay with char delimiters for now. We already define delimiters as chars in the MetricRegistry interface and various internal methods that people may be using.


---

[GitHub] flink issue #4932: [FLINK-7958][metrics] Allow reporters to define default d...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/4932
  
    true, we can use default methods for this, I was concerned about backwards compatibilty but forgot about that option.


---

[GitHub] flink issue #4932: [FLINK-7958][metrics] Allow reporters to define default d...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/4932
  
    I would also stick with interface option since it makes it easier to deal with backwards compatibility. We can just add another interface and keep the code path for the old interface, without polluting the `MetricReporter` interface.


---

[GitHub] flink issue #4932: [FLINK-7958][metrics] Allow reporters to define default d...

Posted by bowenli86 <gi...@git.apache.org>.
Github user bowenli86 commented on the issue:

    https://github.com/apache/flink/pull/4932
  
    I would suggest another solution - rather than adding another interface 'DelimiterProvider', add `getDelimiter()` which returns '.' as an interface default method to `MetricReporter`. Any reporter impl classes that don't override it will use the default delimiter.
    
    BTW, is it better to have `String getDelimiter()` rather than `char getDelimiter()`? Because 1) Flink has to convert char to string anyway 2) the former one provides more flexibility in defining delimiters, e.g. as multi chars 


---