flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bowenli86 <...@git.apache.org>
Subject [GitHub] flink pull request #3736: [Flink-6013][metrics] Add Datadog HTTP metrics rep...
Date Wed, 19 Apr 2017 23:55:23 GMT
Github user bowenli86 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3736#discussion_r112340046
  
    --- Diff: flink-metrics/flink-metrics-datadog/src/main/java/org/apache/flink/metrics/datadog/DatadogHttpClient.java
---
    @@ -0,0 +1,83 @@
    +/*
    + * 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.metrics.datadog;
    +
    +import okhttp3.MediaType;
    +import okhttp3.OkHttpClient;
    +import okhttp3.Request;
    +import okhttp3.Response;
    +import okhttp3.RequestBody;
    +
    +import java.io.IOException;
    +import java.util.concurrent.TimeUnit;
    +
    +/**
    + * Http client talking to Datadog
    + * */
    +public class DatadogHttpClient{
    +	private static final String SERIES_URL_FORMAT = "https://app.datadoghq.com/api/v1/series?api_key=%s";
    +	private static final String VALIDATE_URL_FORMAT = "https://app.datadoghq.com/api/v1/validate?api_key=%s";
    +	private static final MediaType MEDIA_TYPE = MediaType.parse("application/json; charset=utf-8");
    +	private static final int TIMEOUT = 5;
    +
    +	private final String seriesUrl;
    +	private final String validateUrl;
    +	private final OkHttpClient client;
    --- End diff --
    
    You might be looking at shutting down client cache. As the doc there mentioned, "<h3>Shutdown
isn't necessary</h3>" :)


---
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