Get JSON metrics response code.
This commit is contained in:
parent
e15f3c9d2b
commit
405802c492
|
@ -13,11 +13,9 @@ import com.codahale.metrics.Timer;
|
||||||
import com.fasterxml.jackson.core.JsonEncoding;
|
import com.fasterxml.jackson.core.JsonEncoding;
|
||||||
import com.fasterxml.jackson.core.JsonFactory;
|
import com.fasterxml.jackson.core.JsonFactory;
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
|
@ -94,6 +92,8 @@ public class JsonMetricsReporter extends ScheduledReporter {
|
||||||
json.close();
|
json.close();
|
||||||
|
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
|
|
||||||
|
logger.info("Metrics server response: " + connection.getResponseCode());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.warn("Error sending metrics", e);
|
logger.warn("Error sending metrics", e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue