import org.eclipse.tracecompass.internal.tmf.ui.viewers.piecharts.model.TmfPieChartStatisticsModel;
import org.eclipse.tracecompass.internal.tmf.ui.viewers.statistics.model.TmfStatisticsTree;
import org.eclipse.tracecompass.internal.tmf.ui.viewers.statistics.model.TmfStatisticsTreeManager;
+import org.eclipse.tracecompass.internal.tmf.ui.viewers.statistics.model.TmfStatisticsTreeNode;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
import org.eclipse.tracecompass.tmf.core.statistics.ITmfStatistics;
import org.eclipse.tracecompass.tmf.core.statistics.TmfStatisticsEventTypesModule;
import org.eclipse.tracecompass.tmf.core.statistics.TmfStatisticsModule;
-import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
*/
private static final long LIVE_UPDATE_DELAY = 1000;
- /**
- * Timestamp scale used for all statistics (nanosecond)
- */
- private static final byte TIME_SCALE = ITmfTimestamp.NANOSECOND_SCALE;
private TmfTimeRange fTimerange;
/**
protected IStatus run(IProgressMonitor monitor) {
/* Wait until the analysis is ready to be queried */
- fStatsMod.waitForInitialization();
+ if (!fStatsMod.waitForInitialization()) {
+ return Status.CANCEL_STATUS;
+ }
ITmfStatistics stats = fStatsMod.getStatistics();
if (stats == null) {
/* It should have worked, but didn't */
* The generic statistics are stored in nanoseconds, so we must make
* sure the time range is scaled correctly.
*/
- start = localtimeRange.getStartTime().normalize(0, TIME_SCALE).getValue();
- end = localtimeRange.getEndTime().normalize(0, TIME_SCALE).getValue();
+ start = localtimeRange.getStartTime().toNanos();
+ end = localtimeRange.getEndTime().toNanos();
Map<String, Long> map = stats.getEventTypesInRange(start, end);
updateStats(map);
* </pre>
*/
- /* Fill in an the event counts (either cells C or D) */
- for (Map.Entry<String, Long> entry : map.entrySet()) {
- statsData.setTypeCount(name, entry.getKey(), fIsGlobal, entry.getValue());
+ if (map.isEmpty() && !fIsGlobal) {
+ /* Reset all time range event counts (cells D) */
+ TmfStatisticsTreeNode eventTypeNode = statsData.getNode(name, TmfStatisticsTree.HEADER_EVENT_TYPES);
+ if (eventTypeNode != null) {
+ eventTypeNode.resetTimeRangeValue();
+ }
+ } else {
+ /* Fill in the event counts (either cells C or D) */
+ for (Map.Entry<String, Long> entry : map.entrySet()) {
+ statsData.setTypeCount(name, entry.getKey(), fIsGlobal, entry.getValue());
+ }
}
/*