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-8162) Kinesis Connector to report millisBehindLatest metric
Date Mon, 08 Jan 2018 12:24:00 GMT

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

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

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

    https://github.com/apache/flink/pull/5182#discussion_r160131414
  
    --- Diff: flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/ShardConsumer.java
---
    @@ -70,35 +71,45 @@
     
     	private Date initTimestamp;
     
    +	private long millisBehindLatest;
    +
     	/**
     	 * Creates a shard consumer.
     	 *
     	 * @param fetcherRef reference to the owning fetcher
     	 * @param subscribedShardStateIndex the state index of the shard this consumer is subscribed
to
     	 * @param subscribedShard the shard this consumer is subscribed to
     	 * @param lastSequenceNum the sequence number in the shard to start consuming
    +	 * @param kinesisMetricGroup the metric group to report to
     	 */
     	public ShardConsumer(KinesisDataFetcher<T> fetcherRef,
     						Integer subscribedShardStateIndex,
     						StreamShardHandle subscribedShard,
    -						SequenceNumber lastSequenceNum) {
    +						SequenceNumber lastSequenceNum,
    +						MetricGroup kinesisMetricGroup) {
     		this(fetcherRef,
     			subscribedShardStateIndex,
     			subscribedShard,
     			lastSequenceNum,
    -			KinesisProxy.create(fetcherRef.getConsumerConfiguration()));
    +			KinesisProxy.create(fetcherRef.getConsumerConfiguration()),
    +			kinesisMetricGroup);
     	}
     
     	/** This constructor is exposed for testing purposes. */
     	protected ShardConsumer(KinesisDataFetcher<T> fetcherRef,
     							Integer subscribedShardStateIndex,
     							StreamShardHandle subscribedShard,
     							SequenceNumber lastSequenceNum,
    -							KinesisProxyInterface kinesis) {
    +							KinesisProxyInterface kinesis,
    +							MetricGroup kinesisMetricGroup) {
     		this.fetcherRef = checkNotNull(fetcherRef);
     		this.subscribedShardStateIndex = checkNotNull(subscribedShardStateIndex);
     		this.subscribedShard = checkNotNull(subscribedShard);
     		this.lastSequenceNum = checkNotNull(lastSequenceNum);
    +
    +		checkNotNull(kinesisMetricGroup)
    +			.gauge("millisBehindLatest", () -> millisBehindLatest);
    --- End diff --
    
    yes you can use lambdas.


> Kinesis Connector to report millisBehindLatest metric
> -----------------------------------------------------
>
>                 Key: FLINK-8162
>                 URL: https://issues.apache.org/jira/browse/FLINK-8162
>             Project: Flink
>          Issue Type: Improvement
>          Components: Kinesis Connector
>            Reporter: Cristian
>            Priority: Minor
>              Labels: kinesis
>             Fix For: 1.5.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> When reading from Kinesis streams, one of the most valuable metrics is "MillisBehindLatest"
(see https://github.com/aws/aws-sdk-java/blob/25f0821f69bf94ec456f602f2b83ea2b0ca15643/aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/model/GetRecordsResult.java#L187-L201).
> Flink should use its metrics mechanism to report this value as a gauge, tagging it with
the shard id.



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

Mime
View raw message