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

2018-02-14 Thread asfgit
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...

2018-02-07 Thread zentol
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 pull request #5418: [FLINK-8553] switch flink-metrics-datadog to async...

2018-02-06 Thread bowenli86
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 
Date:   2018-02-07T00:11:18Z

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




---