X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=org.eclipse.linuxtools.lttng2.kernel.core.tests%2Fperf%2Forg%2Feclipse%2Flinuxtools%2Flttng2%2Fkernel%2Fcore%2Ftests%2Fperf%2Fevent%2Fmatching%2FTraceSynchronizationBenchmark.java;h=f4ab323eb62245ee9dbc3aecc8cdfd7eeb43ec0a;hb=374cd3cd1bbe4f765b84b3032ddcfecc4e65f71c;hp=5fe6fd25d415e0f907de04eb634f0056454ea4d1;hpb=b09d20dc7dc126ee6734f7c7f8d135b49886afbc;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/TraceSynchronizationBenchmark.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/TraceSynchronizationBenchmark.java index 5fe6fd25d4..f4ab323eb6 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/TraceSynchronizationBenchmark.java +++ b/org.eclipse.linuxtools.lttng2.kernel.core.tests/perf/org/eclipse/linuxtools/lttng2/kernel/core/tests/perf/event/matching/TraceSynchronizationBenchmark.java @@ -12,23 +12,23 @@ package org.eclipse.linuxtools.lttng2.kernel.core.tests.perf.event.matching; -import static org.junit.Assert.fail; +import static org.junit.Assert.assertNotNull; import static org.junit.Assume.assumeTrue; +import java.util.Arrays; + import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpEventMatching; import org.eclipse.linuxtools.lttng2.kernel.core.event.matching.TcpLttngEventMatching; import org.eclipse.linuxtools.tmf.core.event.matching.TmfEventMatching; -import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; +import org.eclipse.linuxtools.tmf.core.synchronization.SynchronizationAlgorithm; +import org.eclipse.linuxtools.tmf.core.synchronization.SynchronizationManager; import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; -import org.eclipse.linuxtools.tmf.core.trace.TmfExperiment; -import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfEvent; import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace; import org.eclipse.linuxtools.tmf.ctf.core.tests.shared.CtfTmfTestTrace; import org.eclipse.test.performance.Dimension; import org.eclipse.test.performance.Performance; import org.eclipse.test.performance.PerformanceMeter; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; /** @@ -42,7 +42,6 @@ public class TraceSynchronizationBenchmark { private static final String TIME = " (time)"; private static final String MEMORY = " (memory usage)"; private static final String TEST_SUMMARY = "Trace synchronization"; - private static int BLOCK_SIZE = 1000; /** * Initialize some data @@ -69,11 +68,7 @@ public class TraceSynchronizationBenchmark { /** * Run the benchmark with 3 bigger traces - * - * TODO: For now, this test takes a lot of RAM. To run, remove the @Ignore - * and set at least 1024Mb RAM, or else there is OutOfMemoryError exception */ - @Ignore @Test public void testDjangoTraces() { assumeTrue(CtfTmfTestTrace.DJANGO_CLIENT.exists()); @@ -94,16 +89,9 @@ public class TraceSynchronizationBenchmark { perf.tagAsSummary(pm, TEST_SUMMARY + ':' + testName + TIME, Dimension.CPU_TIME); for (int i = 0; i < loop_count; i++) { - TmfExperiment experiment = new TmfExperiment(CtfTmfEvent.class, "Test experiment", testTraces, BLOCK_SIZE); - pm.start(); - try { - experiment.synchronizeTraces(true); - } catch (TmfTraceException e) { - fail("Failed at iteration " + i + " with message: " + e.getMessage()); - } + SynchronizationManager.synchronizeTraces(null, Arrays.asList(testTraces), true); pm.stop(); - } pm.commit(); @@ -116,18 +104,14 @@ public class TraceSynchronizationBenchmark { perf.tagAsSummary(pm, TEST_SUMMARY + ':' + testName + MEMORY, Dimension.USED_JAVA_HEAP); for (int i = 0; i < loop_count; i++) { - TmfExperiment experiment = new TmfExperiment(CtfTmfEvent.class, "Test experiment", testTraces, BLOCK_SIZE); System.gc(); pm.start(); - try { - experiment.synchronizeTraces(true); - } catch (TmfTraceException e) { - fail("Failed at iteration " + i + " with message: " + e.getMessage()); - } + SynchronizationAlgorithm algo = SynchronizationManager.synchronizeTraces(null, Arrays.asList(testTraces), true); + assertNotNull(algo); + System.gc(); pm.stop(); - } pm.commit(); }