Skip to content

Commit

Permalink
Removes periodic re-init of statsd reporter (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottopell authored Nov 10, 2023
1 parent 33e7e94 commit b6ec32e
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/main/java/org/datadog/jmxfetch/reporter/StatsdReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class StatsdReporter extends Reporter {
private int statsdPort;
private Boolean telemetry;
private int queueSize;
private long initializationTime;
private boolean nonBlocking;
private int socketBufferSize;
private int socketTimeout;
Expand All @@ -37,8 +36,6 @@ public StatsdReporter(String statsdHost, int statsdPort, boolean telemetry, int
}

private void init() {
initializationTime = System.currentTimeMillis();

// Only set the entityId to "none" if UDS communication is activated
String entityId = this.statsdPort == 0 ? "none" : null;
int defaultUdsDatagramSize = 8192;
Expand Down Expand Up @@ -99,10 +96,6 @@ private void init() {

protected void sendMetricPoint(
String metricType, String metricName, double value, String[] tags) {
if (System.currentTimeMillis() - this.initializationTime > 300 * 1000) {
this.statsDClient.stop();
init();
}
if (metricType.equals("monotonic_count")) {
statsDClient.count(metricName, (long) value, tags);
} else if (metricType.equals("histogram")) {
Expand All @@ -115,11 +108,6 @@ protected void sendMetricPoint(
/** Submits service check. */
public void doSendServiceCheck(
String serviceCheckName, String status, String message, String[] tags) {
if (System.currentTimeMillis() - this.initializationTime > 300 * 1000) {
this.statsDClient.stop();
init();
}

ServiceCheck sc = ServiceCheck.builder()
.withName(serviceCheckName)
.withStatus(this.statusToServiceCheckStatus(status))
Expand Down

0 comments on commit b6ec32e

Please sign in to comment.