
com.librato.metrics.reporter.Numbers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metrics-librato Show documentation
Show all versions of metrics-librato Show documentation
The LibratoReporter class runs in the background, publishing
metrics to the Librato Metrics API at the
specified interval.
The newest version!
package com.librato.metrics.reporter;
public class Numbers {
public static Number getNumberFrom(Object object) {
if (object instanceof Number) {
Number number = (Number)object;
if (isANumber(number)) {
return number;
}
}
return null;
}
public static boolean isANumber(Number number) {
final double doubleValue = number.doubleValue();
return !(Double.isNaN(doubleValue) || Double.isInfinite(doubleValue));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy