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());
}
}
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);
}
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();
}
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();
}
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();
}
}
Aggregations