protected void collectStatsProviders(Collection<StatsProvider> into) { into.add( new ProcessingStats( doneBatches.get() + queuedBatches.get(), doneBatches.get(), totalProcessingTime.total(), totalProcessingTime.average() / numberOfProcessors(), upstreamIdleTime.get(), downstreamIdleTime.get())); into.addAll(additionalStatsProvider); }
protected void resetStats() { downstreamIdleTime.set(0); upstreamIdleTime.set(0); queuedBatches.set(0); doneBatches.set(0); totalProcessingTime.reset(); startTime = currentTimeMillis(); endTime = 0; }