@Override
    public void putEvent(final StatisticEvent statisticEvent, final StatisticStore statisticStore) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("putEvent - count=1");
        }

        final StatisticStoreDoc entity = (StatisticStoreDoc) statisticStore;

        // validate the first stat in the batch to check we have a statistic
        // data source for it.
        if (!validateStatisticDataSource(statisticEvent, entity)) {
            // no StatisticsDataSource entity so don't record the stat as we
            // will have no way of querying the stat
            throw new RuntimeException(String.format("Invalid or missing statistic datasource with name %s",
                    entity.getName()));
        }

        final Predicate<StatisticEvent> insideProcessingThresholdPredicate = getInsideProcessingThresholdPredicate();

        // Only process a stat if it is inside the processing threshold
        if (insideProcessingThresholdPredicate.test(statisticEvent)) {
            final RolledUpStatisticEvent rolledUpStatisticEvent = generateTagRollUps(statisticEvent, entity);
            try {
                // Will block until an object is available to borrow
                final SQLStatisticAggregateMap statisticAggregateMap = objectPool.borrowObject();
                try {
                    statisticAggregateMap.addRolledUpEvent(rolledUpStatisticEvent, entity.getPrecision());
                } finally {
                    objectPool.returnObject(statisticAggregateMap);
                }
            } catch (final StatisticsEventValidationException seve) {
                throw new RuntimeException(seve.getMessage(), seve);
            } catch (final InterruptedException e) {
                Thread.currentThread().interrupt();
                LOGGER.error("putEvent()", e);
                throw new RuntimeException("Exception adding statistics to the aggregateMap", e);
            } catch (final Exception e) {
                LOGGER.error("putEvent()", e);
                throw new RuntimeException("Exception adding statistics to the aggregateMap", e);
            }
        }
    }
@return A predicate that will test if an event is within the processing age threshold, or if there
is no configured max age then process all events
stroom-statistics/stroom-statistics-impl-sql/src/main/java/stroom/statistics/impl/sql/SQLStatisticEventStore.java