From: Mathieu Denis Date: Wed, 22 Aug 2012 15:47:36 +0000 (-0400) Subject: tmf: some updates to the statistics X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=eeb388b178bed922963f869ce4e51e459cd82b16;p=deliverable%2Ftracecompass.git tmf: some updates to the statistics - Changes the statistics node reset behavior to avoid useless operations; - Removes unused messages; - Updates some javadoc; Change-Id: I5af35217a711cdce06807929c4621dfb88cd2fa1 Signed-off-by: Mathieu Denis Reviewed-on: https://git.eclipse.org/r/7333 Reviewed-by: Alexandre Montplaisir IP-Clean: Alexandre Montplaisir Tested-by: Alexandre Montplaisir Reviewed-by: Bernd Hufmann IP-Clean: Bernd Hufmann Tested-by: Bernd Hufmann --- diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/TmfStatisticsRequest.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/TmfStatisticsRequest.java index ec09c925ee..36bac58809 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/TmfStatisticsRequest.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/TmfStatisticsRequest.java @@ -67,7 +67,6 @@ public class TmfStatisticsRequest extends TmfEventRequest { fLastEventIndex = index; } - @Override public void handleData(ITmfEvent data) { ++fLastEventIndex; diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/AbsTmfStatisticsTree.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/AbsTmfStatisticsTree.java index 41577eaa4d..b372a58865 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/AbsTmfStatisticsTree.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/AbsTmfStatisticsTree.java @@ -34,7 +34,7 @@ import org.eclipse.linuxtools.tmf.ui.viewers.statistics.ITmfExtraEventInfo; public abstract class AbsTmfStatisticsTree { /** - * String builder used to merge string more efficienctly. + * String builder used to merge string more efficiently. */ protected static final StringBuilder fBuilder = new StringBuilder(); @@ -44,7 +44,7 @@ public abstract class AbsTmfStatisticsTree { public static final TmfFixedArray ROOT = new TmfFixedArray("root"); //$NON-NLS-1$ /** - * Function to merge many string more efficienctly. + * Function to merge many string more efficiently. * * @param strings * Strings to merge. @@ -201,7 +201,7 @@ public abstract class AbsTmfStatisticsTree { protected abstract void registerName(final TmfFixedArray path); /** - * Reset a node. + * Resets a node. * * Works recursively. * @@ -226,7 +226,6 @@ public abstract class AbsTmfStatisticsTree { */ public void resetTimeRangeValue(final TmfFixedArray path) { for (TmfStatisticsTreeNode node : getChildren(path)) { - resetTimeRangeValue(node.getPath()); node.resetTimeRangeValue(); } } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfBaseStatisticsTree.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfBaseStatisticsTree.java index 0d85447da1..4df3f3f9cc 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfBaseStatisticsTree.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfBaseStatisticsTree.java @@ -217,8 +217,6 @@ public class TmfBaseStatisticsTree extends AbsTmfStatisticsTree { @SuppressWarnings({ "rawtypes", "unchecked" }) protected TmfFixedArray[] getTypePaths(ITmfEvent event, ITmfExtraEventInfo extraInfo) { String trace = extraInfo.getTraceName(); - // String type = event.getType().getTypeId(); // Add too much - // informations String type = event.getType().toString(); TmfFixedArray[] paths = { new TmfFixedArray(trace, HEADER_EVENT_TYPES, type) }; diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfStatisticsTreeNode.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfStatisticsTreeNode.java index b1d97a8547..ca68a8cf4c 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfStatisticsTreeNode.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfStatisticsTreeNode.java @@ -161,6 +161,8 @@ public class TmfStatisticsTreeNode { * Resets the number of events in the time range. It doesn't remove any node * and doesn't modify the global event count. * + * Works recursively. + * * @since 2.0 */ public void resetTimeRangeValue() { diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfStatisticsTreeRootFactory.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfStatisticsTreeRootFactory.java index 130d84724a..a904d1de4f 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfStatisticsTreeRootFactory.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfStatisticsTreeRootFactory.java @@ -38,7 +38,7 @@ public class TmfStatisticsTreeRootFactory { * * @param traceUniqueId * Unique ID for the trace - * @return the corresponding trace statistics tree + * @return The root node of the corresponding trace statistics tree */ public static TmfStatisticsTreeNode getStatTreeRoot(String traceUniqueId) { diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/Messages.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/Messages.java index cd8abf50a1..da24ea62b9 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/Messages.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/Messages.java @@ -25,11 +25,6 @@ public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.ui.views.statistics.messages"; //$NON-NLS-1$ - /** - * String for unknown trace name. - */ - public static String TmfStatisticsView_UnknownTraceName; - /** * String for the global tab name * @since 2.0 diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java index 45a03ae356..3504a44f76 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java @@ -193,7 +193,7 @@ public class TmfStatisticsView extends TmfView { /** * Creates the statistics viewers for all traces in the experiment and - * popupale a viewer folder. Each viewer is placed in a different tab and + * populates a viewer folder. Each viewer is placed in a different tab and * the first one is selected automatically. * * It uses the extension point that defines the statistics viewer to build @@ -215,7 +215,7 @@ public class TmfStatisticsView extends TmfView { TmfStatisticsViewer globalViewer = new TmfStatisticsViewer(); if (fExperiment != null) { // Shows the name of the experiment in the global tab - globalViewer.init( folder, Messages.TmfStatisticsView_GlobalTabName + " - " + fExperiment.getName(), fExperiment); //$NON-NLS-1$ + globalViewer.init(folder, Messages.TmfStatisticsView_GlobalTabName + " - " + fExperiment.getName(), fExperiment); //$NON-NLS-1$ fStatsViewers.addTab(globalViewer, Messages.TmfStatisticsView_GlobalTabName, defaultStyle); String traceName;