Search in sources :

Example 51 with ISegment

use of org.eclipse.tracecompass.segmentstore.core.ISegment in project tracecompass by tracecompass.

the class AbstractStatsAnalysisTest method testPerTypeStats.

/**
 * Test per-type statistics
 *
 * @throws TmfAnalysisException
 *             should not happen
 */
@Test
public void testPerTypeStats() throws TmfAnalysisException {
    TmfXmlTraceStub trace = new TmfXmlTraceStubNs();
    StubSegmentStatisticsAnalysis fixture = getValidSegmentStats(trace);
    Map<@NonNull String, IStatistics<@NonNull ISegment>> perTypeStats = fixture.getStatsPerType();
    assertNotNull(perTypeStats);
    // no need to test the content much as it is tested in the other test.
    assertEquals(2, perTypeStats.size());
    assertEquals(ImmutableSet.<String>of("odd", "even"), perTypeStats.keySet());
    IStatistics<@NonNull ISegment> segmentStoreStatistics = perTypeStats.get("even");
    assertNotNull(segmentStoreStatistics);
    // starts with 0  so size + 1
    assertEquals(StubSegmentStatisticsAnalysis.SIZE / 2 + 1, segmentStoreStatistics.getNbElements());
    trace.dispose();
    fixture.dispose();
}
Also used : TmfXmlTraceStubNs(org.eclipse.tracecompass.tmf.tests.stubs.trace.xml.TmfXmlTraceStubNs) TmfXmlTraceStub(org.eclipse.tracecompass.tmf.tests.stubs.trace.xml.TmfXmlTraceStub) NonNull(org.eclipse.jdt.annotation.NonNull) IStatistics(org.eclipse.tracecompass.analysis.timing.core.statistics.IStatistics) ISegment(org.eclipse.tracecompass.segmentstore.core.ISegment) Test(org.junit.Test)

Aggregations

ISegment (org.eclipse.tracecompass.segmentstore.core.ISegment)51 Test (org.junit.Test)22 NonNull (org.eclipse.jdt.annotation.NonNull)7 Nullable (org.eclipse.jdt.annotation.Nullable)7 SWTBotTable (org.eclipse.swtbot.swt.finder.widgets.SWTBotTable)7 ISegmentStoreProvider (org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider)7 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)6 IAnalysisModule (org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule)6 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)5 Map (java.util.Map)4 Predicate (java.util.function.Predicate)4 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)4 IStatistics (org.eclipse.tracecompass.analysis.timing.core.statistics.IStatistics)4 BasicSegment (org.eclipse.tracecompass.segmentstore.core.BasicSegment)4 ISegmentStore (org.eclipse.tracecompass.segmentstore.core.ISegmentStore)4 Objects (java.util.Objects)3 TableViewer (org.eclipse.jface.viewers.TableViewer)3 Performance (org.eclipse.test.performance.Performance)3 PerformanceMeter (org.eclipse.test.performance.PerformanceMeter)3