1 /*******************************************************************************
2 * Copyright (c) 2016 École Polytechnique de Montréal
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.analysis
.timing
.ui
.views
.segmentstore
.statistics
;
12 import org
.eclipse
.jdt
.annotation
.NonNull
;
13 import org
.eclipse
.jdt
.annotation
.Nullable
;
14 import org
.eclipse
.swt
.widgets
.Composite
;
15 import org
.eclipse
.tracecompass
.analysis
.timing
.core
.segmentstore
.ISegmentStoreProvider
;
16 import org
.eclipse
.tracecompass
.analysis
.timing
.core
.segmentstore
.statistics
.AbstractSegmentStatisticsAnalysis
;
17 import org
.eclipse
.tracecompass
.segmentstore
.core
.ISegment
;
18 import org
.eclipse
.tracecompass
.segmentstore
.core
.segment
.interfaces
.INamedSegment
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.analysis
.IAnalysisModule
;
20 import org
.eclipse
.tracecompass
.tmf
.core
.analysis
.TmfAbstractAnalysisModule
;
21 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfTrace
;
24 * Generic viewer to show segment store statistics analysis data.
28 public class SegmentStoreStatisticsViewer
extends AbstractSegmentsStatisticsViewer
{
30 private final String fAnalysisId
;
36 * The parent composite
38 * The ID of the segment store provider to do statistics on
40 public SegmentStoreStatisticsViewer(Composite parent
, String analysisId
) {
42 fAnalysisId
= analysisId
;
46 protected @Nullable TmfAbstractAnalysisModule
createStatisticsAnalysiModule() {
47 AbstractSegmentStatisticsAnalysis module
= new AbstractSegmentStatisticsAnalysis() {
50 protected @Nullable String
getSegmentType(@NonNull ISegment segment
) {
51 if (segment
instanceof INamedSegment
) {
52 return ((INamedSegment
) segment
).getName();
58 protected @Nullable ISegmentStoreProvider
getSegmentProviderAnalysis(@NonNull ITmfTrace trace
) {
59 IAnalysisModule m
= trace
.getAnalysisModule(fAnalysisId
);
60 if (!(m
instanceof ISegmentStoreProvider
)) {
63 return (ISegmentStoreProvider
) m
;