Search in sources :

Example 6 with ITmfTrace

use of org.eclipse.tracecompass.tmf.core.trace.ITmfTrace in project tracecompass by tracecompass.

the class ExperimentBenchmark method init.

/**
 * Initialization
 *
 * @param maxTraces
 *            maximum number of traces to open
 */
private void init(int maxTraces) {
    try {
        File parentDir = new File(TRACES_ROOT_PATH);
        File[] traceFiles = parentDir.listFiles();
        ITmfTrace[] traces = new CtfTmfTrace[Math.min(maxTraces, traceFiles.length)];
        for (int i = 0; i < traces.length; i++) {
            traces[i] = new CtfTmfTrace();
        }
        int j = 0;
        for (int i = 0; i < (traces.length) && (j < traces.length); i++) {
            String absolutePath = traceFiles[j].getAbsolutePath();
            if (traces[i].validate(null, absolutePath).isOK()) {
                traces[i].initTrace(null, absolutePath, ITmfEvent.class);
            } else {
                i--;
            }
            j++;
        }
        fExperiment = new TmfExperimentStub("MegaExperiment", traces, BLOCK_SIZE);
        if (traces[traces.length - 1].getPath() == null) {
            throw new TmfTraceException("Insufficient valid traces in directory");
        }
    } catch (TmfTraceException e) {
        System.out.println(e.getMessage());
    }
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) TmfTraceException(org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException) TmfExperimentStub(org.eclipse.tracecompass.tmf.tests.stubs.trace.TmfExperimentStub) File(java.io.File) CtfTmfTrace(org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace)

Example 7 with ITmfTrace

use of org.eclipse.tracecompass.tmf.core.trace.ITmfTrace in project tracecompass by tracecompass.

the class CtfTmfLostEventStatisticsTest method setUp.

// ------------------------------------------------------------------------
// Maintenance
// ------------------------------------------------------------------------
/**
 * Test setup
 */
@BeforeClass
public static void setUp() {
    ITmfTrace trace = CtfTmfTestTraceUtils.getTrace(lostEventsTrace);
    fTrace = trace;
    /* Prepare the two analysis-backed state systems */
    fTotalsMod = new TmfStatisticsTotalsModule();
    fEventTypesMod = new TmfStatisticsEventTypesModule();
    try {
        fTotalsMod.setTrace(trace);
        fEventTypesMod.setTrace(trace);
    } catch (TmfAnalysisException e) {
        fail();
    }
    fTotalsMod.schedule();
    fEventTypesMod.schedule();
    assertTrue(fTotalsMod.waitForCompletion());
    assertTrue(fEventTypesMod.waitForCompletion());
    ITmfStateSystem totalsSS = fTotalsMod.getStateSystem();
    ITmfStateSystem eventTypesSS = fEventTypesMod.getStateSystem();
    assertNotNull(totalsSS);
    assertNotNull(eventTypesSS);
    fStats = new TmfStateStatistics(totalsSS, eventTypesSS);
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) TmfStatisticsTotalsModule(org.eclipse.tracecompass.tmf.core.statistics.TmfStatisticsTotalsModule) TmfAnalysisException(org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException) TmfStateStatistics(org.eclipse.tracecompass.tmf.core.statistics.TmfStateStatistics) TmfStatisticsEventTypesModule(org.eclipse.tracecompass.tmf.core.statistics.TmfStatisticsEventTypesModule) ITmfStateSystem(org.eclipse.tracecompass.statesystem.core.ITmfStateSystem) BeforeClass(org.junit.BeforeClass)

Example 8 with ITmfTrace

use of org.eclipse.tracecompass.tmf.core.trace.ITmfTrace in project tracecompass by tracecompass.

the class EventMatchingBenchmark method testDjangoTraces.

/**
 * Run the benchmark with 3 bigger traces
 */
@Test
public void testDjangoTraces() {
    CtfTmfTrace trace1 = CtfTmfTestTraceUtils.getTrace(CtfTestTrace.DJANGO_CLIENT);
    CtfTmfTrace trace2 = CtfTmfTestTraceUtils.getTrace(CtfTestTrace.DJANGO_DB);
    CtfTmfTrace trace3 = CtfTmfTestTraceUtils.getTrace(CtfTestTrace.DJANGO_HTTPD);
    Set<@NonNull ITmfTrace> traces = ImmutableSet.of(trace1, trace2, trace3);
    runCpuTest(traces, "Django traces", 10);
    runMemoryTest(traces, "Django traces", 10);
    trace1.dispose();
    trace2.dispose();
    trace3.dispose();
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) CtfTmfTrace(org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace) Test(org.junit.Test)

Example 9 with ITmfTrace

use of org.eclipse.tracecompass.tmf.core.trace.ITmfTrace in project tracecompass by tracecompass.

the class TraceSynchronizationBenchmark method testDjangoTraces.

/**
 * Run the benchmark with 3 bigger traces
 */
@Test
public void testDjangoTraces() {
    CtfTmfTrace trace1 = CtfTmfTestTraceUtils.getTrace(CtfTestTrace.DJANGO_CLIENT);
    CtfTmfTrace trace2 = CtfTmfTestTraceUtils.getTrace(CtfTestTrace.DJANGO_DB);
    CtfTmfTrace trace3 = CtfTmfTestTraceUtils.getTrace(CtfTestTrace.DJANGO_HTTPD);
    ITmfTrace[] traces = { trace1, trace2, trace3 };
    TmfExperiment experiment = new TmfExperiment(CtfTmfEvent.class, "Test experiment", traces, TmfExperiment.DEFAULT_INDEX_PAGE_SIZE, null);
    runCpuTest(experiment, "Django traces", 10);
    runMemoryTest(experiment, "Django traces", 10);
    trace1.dispose();
    trace2.dispose();
    trace3.dispose();
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) TmfExperiment(org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment) CtfTmfTrace(org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace) Test(org.junit.Test)

Example 10 with ITmfTrace

use of org.eclipse.tracecompass.tmf.core.trace.ITmfTrace in project tracecompass by tracecompass.

the class DistributedCriticalPathTest method testNetworkExchangeOneTrace.

/**
 * Test the graph building of a simple network exchange but without the
 * other machine's trace. The process should be blocked by network
 *
 * @throws TmfTraceException
 *             Exception thrown by opening experiment
 * @throws TmfAnalysisException
 *             Exception thrown by analyses
 */
@Test
public void testNetworkExchangeOneTrace() throws TmfTraceException, TmfAnalysisException {
    ITmfTrace experiment = setUpExperiment("testfiles/graph/network_exchange_wifi.xml");
    assertNotNull(experiment);
    try {
        internalTestNetworkExchangeOneTrace(experiment);
    } finally {
        experiment.dispose();
    }
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) Test(org.junit.Test)

Aggregations

ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)352 Test (org.junit.Test)120 NonNull (org.eclipse.jdt.annotation.NonNull)47 ITmfEvent (org.eclipse.tracecompass.tmf.core.event.ITmfEvent)45 TmfExperiment (org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment)33 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)27 ITmfContext (org.eclipse.tracecompass.tmf.core.trace.ITmfContext)27 Nullable (org.eclipse.jdt.annotation.Nullable)25 TmfSignalHandler (org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)25 IAnalysisModule (org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule)23 TmfTraceOpenedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal)22 TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)22 File (java.io.File)21 BeforeClass (org.junit.BeforeClass)21 ArrayList (java.util.ArrayList)20 ITmfStateSystem (org.eclipse.tracecompass.statesystem.core.ITmfStateSystem)19 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)17 TmfAnalysisException (org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException)15 TmfTraceSelectedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfTraceSelectedSignal)15 TmfTrace (org.eclipse.tracecompass.tmf.core.trace.TmfTrace)15