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-4812) Report Watermark metrics in all operators
Date Wed, 29 Nov 2017 10:02:01 GMT

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

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

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

    https://github.com/apache/flink/pull/5092#discussion_r153736792
  
    --- Diff: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/metrics/StreamOperatorWatermarkMetricsTest.java
---
    @@ -0,0 +1,96 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.flink.streaming.runtime.metrics;
    +
    +import org.apache.flink.streaming.api.operators.AbstractStreamOperator;
    +import org.apache.flink.streaming.api.operators.OneInputStreamOperator;
    +import org.apache.flink.streaming.api.operators.TwoInputStreamOperator;
    +import org.apache.flink.streaming.api.watermark.Watermark;
    +import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
    +import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
    +import org.apache.flink.streaming.util.TwoInputStreamOperatorTestHarness;
    +
    +import org.junit.Assert;
    +import org.junit.Test;
    +
    +/**
    + * Tests to verify that {@link AbstractStreamOperator} properly updates the {@link WatermarkGauge}.
    + */
    +public class StreamOperatorWatermarkMetricsTest {
    +
    +	@Test
    +	public void testOneInputWatermarkReporting() throws Exception {
    +		TestOneInputStreamOperator operator = new TestOneInputStreamOperator();
    +		try (OneInputStreamOperatorTestHarness<Integer, Integer> harness = new OneInputStreamOperatorTestHarness<>(operator))
{
    +			harness.setup();
    +			WatermarkGauge watermarkGauge = operator.getWatermarkGauge();
    +
    +			Assert.assertEquals(Long.MIN_VALUE, watermarkGauge.getValue().longValue());
    +
    +			harness.processWatermark(new Watermark(64L));
    +			Assert.assertEquals(64L, watermarkGauge.getValue().longValue());
    +			harness.processWatermark(new Watermark(128L));
    +			Assert.assertEquals(128L, watermarkGauge.getValue().longValue());
    +		}
    +	}
    +
    +	@Test
    +	public void testTwoInputWatermarkReporting() throws Exception {
    --- End diff --
    
    Probably should add verifying the gauge value after processing the `Long.MAX_VALUE` watermark
on both inputs to this test, just to be on the safe side.


> Report Watermark metrics in all operators
> -----------------------------------------
>
>                 Key: FLINK-4812
>                 URL: https://issues.apache.org/jira/browse/FLINK-4812
>             Project: Flink
>          Issue Type: Improvement
>          Components: Metrics
>            Reporter: Robert Metzger
>            Assignee: Chesnay Schepler
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> As reported by a user, Flink does currently not export the current low watermark for
sources (http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/currentLowWatermark-metric-not-reported-for-all-tasks-td13770.html).
> This JIRA is for adding such a metric for the sources as well.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message