You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by bowenli86 <gi...@git.apache.org> on 2018/02/07 00:29:47 UTC

[GitHub] flink pull request #5418: [FLINK-8553] switch flink-metrics-datadog to async...

GitHub user bowenli86 opened a pull request:

    https://github.com/apache/flink/pull/5418

    [FLINK-8553] switch flink-metrics-datadog to async mode

    ## What is the purpose of the change
    
    Currently DatadogHttpClient in flink-metrics-datadog send http request synchronously. It takes up to 3 sec depending on the network condition, and may slow Flink down.
    
    Switching DatadogHttpClient to async mode.
    
    Some benchmarking with averages from 20 rounds:
    - with 20 metrics, async took 2 millisec and sync took 150 millisec
    - with 200 metrics, async took 5 millisec and sync took 295 millisec
    
    So switching to async will improve the perf by about 50-70X 
    
    ## Brief change log
    
    Switching DatadogHttpClient to async mode.
    
    ## Verifying this change
    
    This change is a trivial rework / code cleanup without any test coverage.
    
    ## Does this pull request potentially affect one of the following parts:
    
    none
    
    ## Documentation
    
    none

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bowenli86/flink FLINK-8553

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/5418.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5418
    
----
commit 19c48d78702329687584295c0370434318527445
Author: Bowen Li <bo...@...>
Date:   2018-02-07T00:11:18Z

    [FLINK-8553] switch flink-metrics-datadog to async mode

----


---

[GitHub] flink issue #5418: [FLINK-8553] switch flink-metrics-datadog to async mode

Posted by bowenli86 <gi...@git.apache.org>.
Github user bowenli86 commented on the issue:

    https://github.com/apache/flink/pull/5418
  
    cc @zentol 


---

[GitHub] flink pull request #5418: [FLINK-8553] switch flink-metrics-datadog to async...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/5418


---

[GitHub] flink pull request #5418: [FLINK-8553] switch flink-metrics-datadog to async...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5418#discussion_r166564479
  
    --- Diff: flink-metrics/flink-metrics-datadog/src/main/java/org/apache/flink/metrics/datadog/DatadogHttpClient.java ---
    @@ -94,4 +96,22 @@ public void close() {
     		client.dispatcher().executorService().shutdown();
     		client.connectionPool().evictAll();
     	}
    +
    +	private static class EmptyCallback implements Callback {
    +		private static final EmptyCallback singleton = new EmptyCallback();
    +
    +		public static Callback getEmptyCallback() {
    +			return singleton;
    +		}
    +
    +		@Override
    +		public void onFailure(Call call, IOException e) {
    +			// Do nothing
    --- End diff --
    
    Let's log the exception at least as DEBUG.


---

[GitHub] flink issue #5418: [FLINK-8553] switch flink-metrics-datadog to async mode

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/5418
  
    merging.


---