class TaskResultStatisticJob extends AbstractStatisticJob {

    @Override
    public void execute(final JobExecutionContext context) throws JobExecutionException {
        Optional<TaskResultStatistics> latestOne = repository.findLatestTaskResultStatistics(statisticInterval);
        if (latestOne.isPresent()) {
            fillBlankIfNeeded(latestOne.get());
        }
        TaskResultStatistics taskResultStatistics = new TaskResultStatistics(
                sharedData.getSuccessCount(), sharedData.getFailedCount(), statisticInterval,
                StatisticTimeUtils.getCurrentStatisticTime(statisticInterval));
        log.debug("Add taskResultStatistics, statisticInterval is:{}, successCount is:{}, failedCount is:{}", 
                statisticInterval, sharedData.getSuccessCount(), sharedData.getFailedCount());
        repository.add(taskResultStatistics);
        sharedData.reset();
    }

}