use of org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider in project tracecompass by tracecompass.
the class PatternProvidersTest method testSegmentStore.
/**
* Test the generated segment store
*/
@Test
public void testSegmentStore() {
TmfAbstractAnalysisModule module = getModule();
if (module instanceof ITmfAnalysisModuleWithStateSystems) {
// In this test, the module will be XmlPatternAnalysis which is an instance of ITmfAnalysisModuleWithStateSystems
assertTrue(((ITmfAnalysisModuleWithStateSystems) module).waitForInitialization());
}
assertTrue(module.waitForCompletion());
ISegmentStore<@NonNull ISegment> ss = ((ISegmentStoreProvider) module).getSegmentStore();
assertNotNull(ss);
assertFalse(ss.isEmpty());
}
use of org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider in project tracecompass by tracecompass.
the class AbstractSegmentStatisticsAnalysis method getDependentAnalyses.
@Override
protected Iterable<IAnalysisModule> getDependentAnalyses() {
ITmfTrace trace = getTrace();
if (trace != null) {
ISegmentStoreProvider provider = getSegmentProviderAnalysis(trace);
fSegmentStoreProviderModule = provider;
if (provider instanceof IAnalysisModule) {
return ImmutableList.of((IAnalysisModule) provider);
}
}
return super.getDependentAnalyses();
}
use of org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider in project tracecompass by tracecompass.
the class AbstractSegmentStatisticsAnalysis method getSegmentStore.
/**
* Get the segment store from which we want the statistics
*
* @return The segment store
*/
@Nullable
private Iterable<@NonNull ISegment> getSegmentStore(long start, long end) {
ISegmentStoreProvider segmentStoreProviderModule = fSegmentStoreProviderModule;
if (segmentStoreProviderModule == null) {
return null;
}
if (segmentStoreProviderModule instanceof IAnalysisModule) {
((IAnalysisModule) segmentStoreProviderModule).waitForCompletion();
}
long t0 = Long.min(start, end);
long t1 = Long.max(start, end);
ISegmentStore<@NonNull ISegment> segmentStore = segmentStoreProviderModule.getSegmentStore();
return segmentStore != null ? isEternity(t0, t1) ? segmentStore : segmentStore.getIntersectingElements(t0, t1) : Collections.emptyList();
}
use of org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider in project tracecompass by tracecompass.
the class SegmentTableTest method getSegStoreProvider.
/**
* get the segment store provider
*
* @return the segment store provider
*/
protected ISegmentStoreProvider getSegStoreProvider() {
ISegmentStoreProvider ssp = fSsp;
if (ssp == null) {
ssp = new SimpleSegmentStoreProvider();
fSsp = ssp;
}
return ssp;
}
use of org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider in project tracecompass by tracecompass.
the class AbstractSegmentStoreScatterChartTreeViewer2 method getProvider.
@Override
@Nullable
protected ITmfTreeDataProvider<@NonNull ITmfTreeDataModel> getProvider(@NonNull ITmfTrace trace) {
String analysisId = getAnalysisId();
/* Support legacy code, get the analysis ID of the segment store */
if (analysisId.isEmpty()) {
return null;
}
/* End support of legacy */
// TODO: Find another mechanism to update the view rather than listeners, so
// that we don't need to expose the analysis to the view
IAnalysisModule module = TmfTraceUtils.getAnalysisModuleOfClass(trace, IAnalysisModule.class, analysisId);
if (!(module instanceof ISegmentStoreProvider)) {
return null;
}
fSegmentProvider = (ISegmentStoreProvider) module;
((ISegmentStoreProvider) module).addListener(fListener);
return DataProviderManager.getInstance().getDataProvider(trace, SegmentStoreScatterDataProvider.ID + ':' + analysisId, ITmfTreeXYDataProvider.class);
}
Aggregations