public void Go() { float actualPerformanceIndex = getPerformanceIndex( configuration.ActualPerformanceIndexFile()); float thresholdPerformanceIndex = getPerformanceIndex( configuration.ThresholdPerformanceIndexFile(version.ToLower())); Dictionary <string, float> performanceSummary = getBenchmarkObjectives( configuration.PerformanceSummaryFile()); Dictionary <string, long> durationSummary = getDurationSummary(performanceSummary); Dictionary <string, float> performanceThreshold = getBenchmarkObjectives( configuration.PerformanceThresholdFile(version)); CompareTests compareTests = new CompareTests(performanceSummary, performanceThreshold, durationSummary , configuration.PerformanceOutputFile()); compareTests.setPerformanceParameters(actualPerformanceIndex, thresholdPerformanceIndex , configuration.getTolerance(version) , configuration.getImprovementTolerance(version)); compareTests.makeComparatorResults(); if (verify) { System.Console.WriteLine("Writing comparison results to a file."); compareTests.writeResultsToXmlFile(); } else if (compareTests.isAllUpdatable()) { //copy actual to threshold try { File.Copy(configuration.PerformanceSummaryFile() , configuration.PerformanceThresholdFile(version), true); } catch (Exception e) { System.Console.WriteLine("\nFile Copy error! PerformanceSummaryFile(): {0} PerformanceThresholdFile(): {1}\n Exception: {2}" , configuration.PerformanceSummaryFile() , configuration.PerformanceThresholdFile(version) , e.StackTrace); } try { File.Copy(configuration.ActualPerformanceIndexFile() , configuration.ThresholdPerformanceIndexFile(version.ToLower()), true); } catch (Exception e) { System.Console.WriteLine("\nFile Copy error! ActualPerformanceIndexFile(): {0} ThresholdPerformanceIndexFile(): {1}\n Exception: {2}" , configuration.ActualPerformanceIndexFile() , configuration.ThresholdPerformanceIndexFile(version.ToLower()) , e.StackTrace); } } }
public void Go() { Dictionary <string, float> duplications = verify ? getCpdCheckFiles() : getSumaryFile(configuration.CpdSummaryFile()); if (verify) { saveDuplicationSummary(configuration.CpdSummaryFile(), duplications); } Dictionary <string, float> thresholds = getSumaryFile(configuration.CpdThresholdFile()); CompareTests compareTests = new CompareTests(duplications, thresholds, null //durations = null !!! , configuration.CpdOutputFile()); compareTests.setPerformanceParameters(1, 1, configuration.getTolerance("CPD") , configuration.getImprovementTolerance("CPD")); compareTests.makeComparatorResults(); if (verify) { compareTests.writeResultsToXmlFile(); } else if (compareTests.isAllUpdatable()) //update { try { File.Copy(configuration.CpdSummaryFile(), configuration.CpdThresholdFile(), true); } catch (Exception e) { System.Console.WriteLine("\nFile Copy error! CpdSummaryFile: {0} CpdThresholdFile: {1}\n Exception: {2}" , configuration.CpdSummaryFile() , configuration.CpdThresholdFile() , e.StackTrace); } } }