private static void runCpuTest(Set<ITmfTrace> testTraces, String testName, int loop_count) {
    Performance perf = Performance.getDefault();
    PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName + TIME);
    perf.tagAsSummary(pm, TEST_SUMMARY + ':' + testName + TIME, Dimension.CPU_TIME);

    for (int i = 0; i < loop_count; i++) {
      TmfEventMatching traceMatch = new TmfEventMatching(testTraces);

      pm.start();
      traceMatch.matchEvents();
      pm.stop();
    }
    pm.commit();
  }
  /* Benchmark memory used by the algorithm */
  private static void runMemoryTest(Set<ITmfTrace> testTraces, String testName, int loop_count) {
    Performance perf = Performance.getDefault();
    PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName + MEMORY);
    perf.tagAsSummary(pm, TEST_SUMMARY + ':' + testName + MEMORY, Dimension.USED_JAVA_HEAP);

    for (int i = 0; i < loop_count; i++) {
      TmfEventMatching traceMatch = new TmfEventMatching(testTraces);

      System.gc();
      pm.start();
      traceMatch.matchEvents();
      System.gc();
      pm.stop();
    }
    pm.commit();
  }
 public void testApplicationStartup() {
   PerformanceMeter meter =
       Performance.getDefault().createPerformanceMeter(getClass().getName() + '.' + getName());
   try {
     meter.stop();
     // tag for showing in the performance fingerprint graph
     Performance performance = Performance.getDefault();
     performance.tagAsGlobalSummary(meter, "Core Headless Startup", Dimension.ELAPSED_PROCESS);
     String reportOption = System.getProperty("eclipseTest.ReportResults");
     boolean bReport = (reportOption == null) ? true : !("false".equalsIgnoreCase(reportOption));
     if (bReport) meter.commit();
     Performance.getDefault()
         .assertPerformanceInRelativeBand(meter, Dimension.ELAPSED_PROCESS, -100, 5);
   } finally {
     meter.dispose();
   }
 }
 protected void assertPerformance() {
   Performance.getDefault().assertPerformance(fPerformanceMeter);
 }
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   Performance performance = Performance.getDefault();
   fPerformanceMeter = performance.createPerformanceMeter(performance.getDefaultScenarioId(this));
 }