@Override
    public void run() {
        try {
            final LogExecutionTime logExecutionTime = new LogExecutionTime();

            final SQLStatisticValueBatchSaveService statisticValueBatchSaveService =
                    new SQLStatisticValueBatchSaveService(null) {
                        @Override
                        protected Connection getConnection() {
                            return SQLStatisticValueBatchSaveServiceTestDatabaseTool.this.getConnection();
                        }
                    };

            for (int l = 0; l < 100; l++) {
                final List<SQLStatValSourceDO> batch = new ArrayList<>();
                for (int i = 0; i < 1000; i++) {
                    long value = System.currentTimeMillis();
                    long count = 100;

                    final SQLStatValSourceDO statisticValueSource = SQLStatValSourceDO.createValueStat(
                            System.currentTimeMillis(),
                            "BATCHTEST" + i,
                            value,
                            count);

                    batch.add(statisticValueSource);
                }
                statisticValueBatchSaveService.saveBatchStatisticValueSource_SinglePreparedStatement(batch);
            }
            LOGGER.info("run() - took {}", logExecutionTime);
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
            System.exit(1);
        }
    }
Utility that can be run as a main method to manually perform aggregation
stroom-statistics/stroom-statistics-impl-sql/src/main/java/stroom/statistics/impl/sql/SQLStatisticValueBatchSaveServiceTestDatabaseTool.java