use of org.platformlayer.metrics.MetricTreeObject in project platformlayer by platformlayer.
the class PlatformlayerMetricsReporter method processGauge.
@Override
public void processGauge(MetricName name, Gauge<?> gauge, MetricTreeObject tree) throws IOException {
MetricTreeObject subtree = getSubtree(tree, name);
Object value = gauge.value();
if (value instanceof Number) {
Number number = (Number) value;
if (value instanceof Float || value instanceof Double) {
double v = number.doubleValue();
subtree.addFloat("value", v);
} else {
long v = number.longValue();
subtree.addFloat("value", v);
}
} else {
LOG.info("Skipping metric: " + name);
}
}
Aggregations