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

Support 'float' and 'java.lang.Float' #76

Merged
merged 4 commits into from
Oct 16, 2015
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
2 changes: 1 addition & 1 deletion src/main/java/org/datadog/jmxfetch/Instance.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class Instance {
private final static Logger LOGGER = Logger.getLogger(Instance.class.getName());
private final static List<String> SIMPLE_TYPES = Arrays.asList("long",
"java.lang.String", "int", "double", "java.lang.Double", "java.lang.Integer", "java.lang.Long",
"java.lang.String", "int", "float", "double", "java.lang.Double","java.lang.Float", "java.lang.Integer", "java.lang.Long",
"java.util.concurrent.atomic.AtomicInteger", "java.util.concurrent.atomic.AtomicLong",
"java.lang.Object", "java.lang.Boolean", "boolean", "java.lang.Number");
private final static List<String> COMPOSED_TYPES = Arrays.asList("javax.management.openmbean.CompositeData", "java.util.HashMap");
Expand Down
25 changes: 0 additions & 25 deletions src/test/java/org/datadog/jmxfetch/CommonTestSetup.java

This file was deleted.

25 changes: 21 additions & 4 deletions src/test/java/org/datadog/jmxfetch/SimpleTestJavaApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,31 @@

public class SimpleTestJavaApp implements SimpleTestJavaAppMBean {

// Integers
private final int shouldBe100 = 100;
private final int shouldBe1000 = 1000;
private final Integer int424242 = new Integer(424242);
private final AtomicInteger atomic42 = new AtomicInteger(42);

private int shouldBeCounter = 0;

// Floats & Long
private final float primitiveFloat = 123.4f;
private final Float instanceFloat = 567.8f;
private final AtomicLong atomic4242 = new AtomicLong(4242);
private final Long long42424242 = new Long(42424242);

// String
private final String shouldBeConverted = "ShouldBe5";
private final String shouldBeDefaulted = "DefaultMe";

// Others
private final boolean shouldBeBoolean = true;
private final HashMap<String, Integer> hashmap = new HashMap<String, Integer>();
private final AtomicInteger atomic42 = new AtomicInteger(42);
private final AtomicLong atomic4242 = new AtomicLong(4242);
private final Object object1337 = new Double(13.37);
private final Long long42424242 = new Long(42424242);
private final Integer int424242 = new Integer(424242);
private final BigDecimal numberBig = new BigDecimal(123456788901234567890.0);


SimpleTestJavaApp() {
hashmap.put("thisis0", 0);
hashmap.put("thisis10", 10);
Expand Down Expand Up @@ -93,5 +104,11 @@ public Integer getInt424242() {
return int424242;
}

public float getPrimitiveFloat(){
return primitiveFloat;
}

public Float getInstanceFloat(){
return instanceFloat;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ public interface SimpleTestJavaAppMBean {

Integer getInt424242();

float getPrimitiveFloat();

Float getInstanceFloat();

}
Loading