use of org.opennms.newts.api.Gauge in project opennms by OpenNMS.
the class NewtsConverter method toSample.
protected static Sample toSample(AbstractDS ds, Resource resource, Timestamp timestamp, double value) {
final String metric = ds.getName();
final MetricType type = ds.isCounter() ? MetricType.COUNTER : MetricType.GAUGE;
final ValueType<?> valueType = ds.isCounter() ? new Counter(UnsignedLong.valueOf(BigDecimal.valueOf(value).toBigInteger())) : new Gauge(value);
return new Sample(timestamp, resource, metric, type, valueType);
}
Aggregations