private void startProfiling() {
        if (LOGGER.isDebugEnabled() && profilingExecutor == null) {
            // If you switch on debugging in ds3 you can find out problem
            // regex's.
            final Runnable command = () -> {
                final ExecutionProfilerTopN top10 = new ExecutionProfilerTopN(root, 10);
                // No point logging if we have no executions
                long totalExecutionTime = top10.getTopN().stream()
                        .mapToLong(ExecutionProfiler::getTotalExecutionTime)
                        .sum();

                if (!top10.getTopN().isEmpty() || totalExecutionTime > 0) {
                    final StringBuilder debugLine = new StringBuilder();
                    debugLine.append("process() - Top 10 executions : ");
                    for (final ExecutionProfiler ex : top10.getTopN()) {
                        debugLine.append("\n\t");
                        debugLine.append(ex.getExecutionString());
                        debugLine.append(" (");
                        debugLine.append(ModelStringUtil.formatCsv(ex.getTotalExecutionCount()));
                        debugLine.append(") ");
                        debugLine.append(ModelStringUtil.formatDurationString(ex.getTotalExecutionTime()));
                    }
                    LOGGER.debug(debugLine.toString());
                }
            };

            profilingExecutor = Executors.newSingleThreadScheduledExecutor();
            profilingExecutor.scheduleWithFixedDelay(command, 10, 10, TimeUnit.SECONDS);
        }
    }
Outputs a data element if required using the current match or another
stored match.
stroom-pipeline/src/main/java/stroom/pipeline/xml/converter/ds3/DS3Parser.java