use of org.apache.metron.profiler.storm.ProfileSplitterBolt.TIMESTAMP_TUPLE_FIELD in project metron by apache.
the class ProfileBuilderBolt method log.
/**
* Logs information about the {@link TupleWindow}.
*
* @param window The tuple window.
*/
private void log(TupleWindow window) {
// summarize the newly received tuples
LongSummaryStatistics received = window.get().stream().map(tuple -> getField(TIMESTAMP_TUPLE_FIELD, tuple, Long.class)).collect(Collectors.summarizingLong(Long::longValue));
LOG.debug("Tuple(s) received; count={}, min={}, max={}, range={} ms", received.getCount(), received.getMin(), received.getMax(), received.getMax() - received.getMin());
if (window.getExpired().size() > 0) {
// summarize the expired tuples
LongSummaryStatistics expired = window.getExpired().stream().map(tuple -> getField(TIMESTAMP_TUPLE_FIELD, tuple, Long.class)).collect(Collectors.summarizingLong(Long::longValue));
LOG.debug("Tuple(s) expired; count={}, min={}, max={}, range={} ms, lag={} ms", expired.getCount(), expired.getMin(), expired.getMax(), expired.getMax() - expired.getMin(), received.getMin() - expired.getMin());
}
}
Aggregations