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

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

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

    https://github.com/apache/flink/pull/5161#discussion_r165000781
  
    --- Diff: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/AbstractStreamOperator.java
 ---
    @@ -194,14 +190,20 @@ public void setup(StreamTask<?, ?> containingTask, 
StreamConfig config, Output<S
                        this.metrics = 
UnregisteredMetricGroups.createUnregisteredOperatorMetricGroup();
                        this.output = output;
                }
    -           Configuration taskManagerConfig = 
container.getEnvironment().getTaskManagerInfo().getConfiguration();
    -           int historySize = 
taskManagerConfig.getInteger(MetricOptions.LATENCY_HISTORY_SIZE);
    -           if (historySize <= 0) {
    -                   LOG.warn("{} has been set to a value equal or below 0: 
{}. Using default.", MetricOptions.LATENCY_HISTORY_SIZE, historySize);
    -                   historySize = 
MetricOptions.LATENCY_HISTORY_SIZE.defaultValue();
    +
    +           try {
    +                   Configuration taskManagerConfig = 
container.getEnvironment().getTaskManagerInfo().getConfiguration();
    +                   int historySize = 
taskManagerConfig.getInteger(MetricOptions.LATENCY_HISTORY_SIZE);
    +                   if (historySize <= 0) {
    +                           LOG.warn("{} has been set to a value equal or 
below 0: {}. Using default.", MetricOptions.LATENCY_HISTORY_SIZE, historySize);
    +                           historySize = 
MetricOptions.LATENCY_HISTORY_SIZE.defaultValue();
    +                   }
    +                   this.latencyStats = new 
LatencyStats(this.metrics.parent().parent().addGroup("latency"), historySize, 
container.getIndexInSubtaskGroup(), getOperatorID());
    --- End diff --
    
    I guess what we could do add another method to the 
`TaskManagerJobMetricGroup` for creating the latency metric group? With that, 
modifications to the metric group structure will result in a compile error if 
`parent().parent()` does not return us to the job metric group.


> LatencyGauge change to  histogram metric
> ----------------------------------------
>
>                 Key: FLINK-7608
>                 URL: https://issues.apache.org/jira/browse/FLINK-7608
>             Project: Flink
>          Issue Type: Bug
>          Components: Metrics
>            Reporter: Hai Zhou UTC+8
>            Assignee: Hai Zhou UTC+8
>            Priority: Major
>             Fix For: 1.5.0
>
>
> I used slf4jReporter[https://issues.apache.org/jira/browse/FLINK-4831]  to 
> export metrics the log file.
> I found:
> {noformat}
> -- Gauges 
> ---------------------------------------------------------------------
> ......
> zhouhai-mbp.taskmanager.f3fd3a269c8c3da4e8319c8f6a201a57.Flink Streaming 
> Job.Map.0.latency:
>  value={LatencySourceDescriptor{vertexID=1, subtaskIndex=-1}={p99=116.0, 
> p50=59.5, min=11.0, max=116.0, p95=116.0, mean=61.833333333333336}}
> zhouhai-mbp.taskmanager.f3fd3a269c8c3da4e8319c8f6a201a57.Flink Streaming 
> Job.Sink- Unnamed.0.latency: 
> value={LatencySourceDescriptor{vertexID=1, subtaskIndex=0}={p99=195.0, 
> p50=163.5, min=115.0, max=195.0, p95=195.0, mean=161.0}}
> ......
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to