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

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

Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2517#discussion_r80886088
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistry.java
 ---
    @@ -216,17 +244,20 @@ public ScopeFormats getScopeFormats() {
         * @param metricName  the name of the metric
         * @param group       the group that contains the metric
         */
    -   public void register(Metric metric, String metricName, MetricGroup 
group) {
    +   public void register(Metric metric, String metricName, 
AbstractMetricGroup group) {
                try {
                        if (reporters != null) {
    -                           for (MetricReporter reporter : reporters) {
    +                           for (int i = 0; i < reporters.size(); i++) {
    +                                   MetricReporter reporter = 
reporters.get(i);
                                        if (reporter != null) {
    -                                           
reporter.notifyOfAddedMetric(metric, metricName, group);
    +                                           FrontMetricGroup front = new 
FrontMetricGroup(i);
    --- End diff --
    
    we will now create a new object every time we add a new metric. Instead, 
keep a single `FrontMetricGroup` instance in the registry, and add a 
`setIndex()` method to it that you call here along with `setReference()`.
    
    but, i just realized that without this you would end up with concurrency 
issues since multiple register calls can be active at the same time...I'll have 
to think about this for a bit.


> [metrics] Delimiter should be configured per reporter
> -----------------------------------------------------
>
>                 Key: FLINK-4564
>                 URL: https://issues.apache.org/jira/browse/FLINK-4564
>             Project: Flink
>          Issue Type: Bug
>          Components: Metrics
>    Affects Versions: 1.1.0
>            Reporter: Chesnay Schepler
>            Assignee: Anton Mushin
>
> Currently, the delimiter used or the scope string is based on a configuration 
> setting shared by all reporters. However, different reporters may have 
> different requirements in regards to the delimiter, as such we should allow 
> reporters to use a different delimiter.
> We can keep the current setting as a global setting that is used if no 
> specific setting was set.



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

Reply via email to