use of com.wavefront.data.DeltaCounterValueException in project java by wavefrontHQ.
the class ReportPointHandlerImpl method reportInternal.
@Override
void reportInternal(ReportPoint point) {
receivedTagCount.update(point.getAnnotations().size());
try {
validatePoint(point, validationConfig);
} catch (DeltaCounterValueException e) {
discardedCounterSupplier.get().inc();
return;
}
receivedPointLag.update(Clock.now() - point.getTimestamp());
if (point.getValue() instanceof Histogram && recompressor != null) {
Histogram histogram = (Histogram) point.getValue();
point.setValue(recompressor.apply(histogram));
}
final String strPoint = serializer.apply(point);
getTask().add(strPoint);
getReceivedCounter().inc();
if (validItemsLogger != null)
validItemsLogger.info(strPoint);
}
use of com.wavefront.data.DeltaCounterValueException in project java by wavefrontHQ.
the class DeltaCounterAccumulationHandlerImpl method reportInternal.
@Override
void reportInternal(ReportPoint point) {
if (DeltaCounter.isDelta(point.getMetric())) {
try {
validatePoint(point, validationConfig);
} catch (DeltaCounterValueException e) {
discardedCounterSupplier.get().inc();
return;
}
getReceivedCounter().inc();
double deltaValue = (double) point.getValue();
receivedPointLag.update(Clock.now() - point.getTimestamp());
HostMetricTagsPair hostMetricTagsPair = new HostMetricTagsPair(point.getHost(), point.getMetric(), point.getAnnotations());
Objects.requireNonNull(aggregatedDeltas.get(hostMetricTagsPair, key -> new AtomicDouble(0))).getAndAdd(deltaValue);
if (validItemsLogger != null && validItemsLogger.isLoggable(Level.FINEST)) {
validItemsLogger.info(serializer.apply(point));
}
} else {
reject(point, "Port is not configured to accept non-delta counter data!");
}
}
Aggregations