public void initSingleStatisticMap() {
   effectiveSingleStatisticMap =
       new HashMap<StatisticType, SingleStatistic>(
           problemBenchmarkResult.getProblemStatisticList().size());
   for (ProblemStatistic problemStatistic : problemBenchmarkResult.getProblemStatisticList()) {
     SingleStatistic singleStatistic = problemStatistic.createSingleStatistic(this);
     effectiveSingleStatisticMap.put(singleStatistic.getStatisticType(), singleStatistic);
   }
   for (PureSingleStatistic pureSingleStatistic : pureSingleStatisticList) {
     effectiveSingleStatisticMap.put(pureSingleStatistic.getStatisticType(), pureSingleStatistic);
   }
 }
Esempio n. 2
0
 public void writeReport() {
   logger.info("Generating benchmark report...");
   summaryDirectory = new File(plannerBenchmarkResult.getBenchmarkReportDirectory(), "summary");
   summaryDirectory.mkdir();
   plannerBenchmarkResult.accumulateResults(this);
   fillWarningList();
   writeBestScoreSummaryCharts();
   writeBestScoreScalabilitySummaryChart();
   writeWinningScoreDifferenceSummaryChart();
   writeWorstScoreDifferencePercentageSummaryChart();
   writeAverageCalculateCountPerSecondSummaryChart();
   writeTimeSpentSummaryChart();
   writeTimeSpentScalabilitySummaryChart();
   writeBestScorePerTimeSpentSummaryChart();
   writeSubSingleBenchmarkScoreCharts();
   for (ProblemBenchmarkResult problemBenchmarkResult :
       plannerBenchmarkResult.getUnifiedProblemBenchmarkResultList()) {
     for (SingleBenchmarkResult singleBenchmarkResult :
         problemBenchmarkResult.getSingleBenchmarkResultList()) {
       for (SubSingleBenchmarkResult subSingleBenchmarkResult :
           singleBenchmarkResult.getSubSingleBenchmarkResultList()) {
         if (!subSingleBenchmarkResult.hasAllSuccess()) {
           continue;
         }
         for (SubSingleStatistic subSingleStatistic :
             subSingleBenchmarkResult.getEffectiveSubSingleStatisticMap().values()) {
           try {
             subSingleStatistic.unhibernatePointList();
           } catch (IllegalStateException e) {
             if (!plannerBenchmarkResult.getAggregation()) {
               throw new IllegalStateException(
                   "Failed to unhibernate point list of SubSingleStatistic ("
                       + subSingleStatistic
                       + ") of SubSingleBenchmark ("
                       + subSingleBenchmarkResult
                       + ").",
                   e);
             }
             logger.trace(
                 "This is expected, aggregator doesn't copy CSV files. Could not read CSV file "
                     + "({}) of sub single statistic ({}).",
                 subSingleStatistic.getCsvFile().getAbsolutePath(),
                 subSingleStatistic);
           }
         }
       }
     }
   }
   for (ProblemBenchmarkResult problemBenchmarkResult :
       plannerBenchmarkResult.getUnifiedProblemBenchmarkResultList()) {
     if (problemBenchmarkResult.hasAnySuccess()) {
       for (ProblemStatistic problemStatistic : problemBenchmarkResult.getProblemStatisticList()) {
         problemStatistic.writeGraphFiles(this);
       }
       for (SingleBenchmarkResult singleBenchmarkResult :
           problemBenchmarkResult.getSingleBenchmarkResultList()) {
         if (singleBenchmarkResult.hasAllSuccess()) {
           for (PureSubSingleStatistic pureSubSingleStatistic :
               singleBenchmarkResult.getMedian().getPureSubSingleStatisticList()) {
             pureSubSingleStatistic.writeGraphFiles(this);
           }
         }
       }
     }
   }
   for (ProblemBenchmarkResult problemBenchmarkResult :
       plannerBenchmarkResult.getUnifiedProblemBenchmarkResultList()) {
     for (SingleBenchmarkResult singleBenchmarkResult :
         problemBenchmarkResult.getSingleBenchmarkResultList()) {
       for (SubSingleBenchmarkResult subSingleBenchmarkResult :
           singleBenchmarkResult.getSubSingleBenchmarkResultList()) {
         if (!subSingleBenchmarkResult.hasAllSuccess()) {
           continue;
         }
         for (SubSingleStatistic subSingleStatistic :
             subSingleBenchmarkResult.getEffectiveSubSingleStatisticMap().values()) {
           if (plannerBenchmarkResult.getAggregation()) {
             subSingleStatistic.setPointList(null);
           } else {
             subSingleStatistic.hibernatePointList();
           }
         }
       }
     }
   }
   determineDefaultShownScoreLevelIndex();
   writeHtmlOverviewFile();
 }