Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Moved version.properties into a dedicated directory #147

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.timgroup.statsd;

import com.timgroup.statsd.Message;

import jnr.unixsocket.UnixDatagramChannel;
import jnr.unixsocket.UnixSocketAddress;
import jnr.unixsocket.UnixSocketOptions;
Expand All @@ -15,10 +13,8 @@
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.Properties;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Callable;
Expand Down Expand Up @@ -296,7 +292,8 @@ public NonBlockingStatsDClient(final String prefix, final int queueSize, String[
telemetryStatsDProcessor = statsDProcessor;

Properties properties = new Properties();
properties.load(getClass().getClassLoader().getResourceAsStream("version.properties"));
properties.load(getClass().getClassLoader().getResourceAsStream(
"dogstatsd/version.properties"));

String telemetryTags = tagString(new String[]{CLIENT_TRANSPORT_TAG + transportType,
CLIENT_VERSION_TAG + properties.getProperty("dogstatsd_client_version"),
Expand Down
7 changes: 2 additions & 5 deletions src/test/java/com/timgroup/statsd/TelemetryTest.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.timgroup.statsd;

import com.timgroup.statsd.Message;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
Expand All @@ -14,8 +12,6 @@
import java.util.ArrayList;
import java.util.Properties;

import com.timgroup.statsd.Message;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.equalTo;
Expand Down Expand Up @@ -151,7 +147,8 @@ public StatsDNonBlockingTelemetry build() throws StatsDClientException {

private static String computeTelemetryTags() throws IOException, Exception {
Properties properties = new Properties();
properties.load(TelemetryTest.class.getClassLoader().getResourceAsStream("version.properties"));
properties.load(TelemetryTest.class.getClassLoader().getResourceAsStream(
"dogstatsd/version.properties"));
return "client:java," + NonBlockingStatsDClient.CLIENT_VERSION_TAG + properties.getProperty("dogstatsd_client_version") + ",client_transport:udp";
}

Expand Down