flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-4923) Expose input/output buffers and bufferPool usage as a metric for a Task
Date Tue, 01 Nov 2016 03:01:59 GMT

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

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

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

    https://github.com/apache/flink/pull/2727#discussion_r85869851
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/TaskIOMetricGroup.java
---
    @@ -80,18 +76,25 @@ public Meter getNumBytesOutRateMeter() {
     		return numBytesOutRate;
     	}
     
    -	public MetricGroup getBuffersGroup() {
    -		return buffers;
    -	}
    -
     	// ------------------------------------------------------------------------
     	//  metrics of Buffers group
     	// ------------------------------------------------------------------------
     
     	/**
    +	 * initialize Buffer Metrics for a task
    +	 */
    +	public void initializeBufferMetrics(Task task) {
    +		final MetricGroup buffers = addGroup("buffers");
    +		buffers.gauge("inputQueueLength", new InputBuffersGauge(task));
    +		buffers.gauge("outputQueueLength", new OutputBuffersGauge(task));
    +		buffers.gauge("inPoolUsage", new InputBufferPoolUsageGauge(task));
    +		buffers.gauge("outPoolUsage", new OutputBufferPoolUsageGauge(task));
    +	}
    +
    +	/**
     	 * Input received buffers gauge of a task
     	 */
    -	public static final class InputBuffersGauge implements Gauge<Integer> {
    +	private final class InputBuffersGauge implements Gauge<Integer> {
    --- End diff --
    
    InputBuffersGauge is unaccessible for any class except TaskIOMetricGroup, so I change
the public to private. It can work no matter whether it is static or not. to save outclass
reference, static is prefer.


> Expose input/output buffers and bufferPool usage as a metric for a Task
> -----------------------------------------------------------------------
>
>                 Key: FLINK-4923
>                 URL: https://issues.apache.org/jira/browse/FLINK-4923
>             Project: Flink
>          Issue Type: Improvement
>          Components: Metrics
>            Reporter: zhuhaifeng
>            Assignee: zhuhaifeng
>            Priority: Minor
>             Fix For: 1.2.0
>
>
> We should expose the following Metrics on the TaskIOMetricGroup:
>  1. Buffers.inputQueueLength: received buffers of InputGates for a task
>  2. Buffers.outputQueueLength: buffers of produced ResultPartitions for a task
>  3. Buffers.inPoolUsage: usage of InputGates buffer pool for a task
>  4. Buffers.outPoolUsage: usage of produced ResultPartitions buffer pool for a task



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

Mime
View raw message