flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zentol <...@git.apache.org>
Subject [GitHub] flink pull request #2386: [FLINK-3660] Measure latency and exposes them via ...
Date Thu, 08 Sep 2016 12:35:52 GMT
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2386#discussion_r77996545
  
    --- Diff: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/AbstractStreamOperator.java
---
    @@ -94,20 +102,38 @@
     	/** Backend for keyed state. This might be empty if we're not on a keyed stream. */
     	private transient KeyedStateBackend<?> keyedStateBackend;
     
    -	protected transient MetricGroup metrics;
    +	// --------------- Metrics ---------------------------
    +
    +	/** Metric group for the operator */
    +	protected MetricGroup metrics;
    +
    +	/** Flag indicating if this operator is a sink */
    +	protected transient boolean isSink = false;
    +
    +	protected LatencyGauge latencyGauge;
    +
     
     	// ------------------------------------------------------------------------
     	//  Life Cycle
     	// ------------------------------------------------------------------------
     
     	@Override
    -	public void setup(StreamTask<?, ?> containingTask, StreamConfig config, Output<StreamRecord<OUT>>
output) {
    +	public void setup(StreamTask<?, ?> containingTask, StreamConfig config, Output<StreamRecord<OUT>>
output, boolean isSink) {
     		this.container = containingTask;
     		this.config = config;
     		String operatorName = containingTask.getEnvironment().getTaskInfo().getTaskName().split("->")[config.getChainIndex()].trim();
     		
     		this.metrics = container.getEnvironment().getMetricGroup().addOperator(operatorName);
     		this.output = new CountingOutput(output, this.metrics.counter("numRecordsOut"));
    +		this.isSink = isSink;
    +		Configuration taskManagerConfig = container.getEnvironment().getTaskManagerInfo().getConfiguration();
    +		int historySize = taskManagerConfig.getInteger(ConfigConstants.METRICS_LATENCY_HISTORY_SIZE,
ConfigConstants.DEFAULT_METRICS_LATENCY_HISTORY_SIZE);
    +		if(historySize <= 0) {
    --- End diff --
    
    missing space after if


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message