analysis: Add count column to latency statistics view
authorJean-Christian Kouame <jean-christian.kouame@ericsson.com>
Fri, 15 Apr 2016 17:45:57 +0000 (13:45 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Tue, 19 Apr 2016 21:15:02 +0000 (17:15 -0400)
Change-Id: Id2db373022a6c1b78ddac2a6c7b580459c189f3a
Signed-off-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/70895
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Hudson CI
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/statistics/AbstractSegmentStoreStatisticsViewer.java
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/statistics/Messages.java
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/statistics/messages.properties

index 30cfda37f7d6e127efec405c40e11187d3419c14..775fd3f3691405de3870459a12c8c1dc1fc77413 100644 (file)
@@ -52,7 +52,8 @@ public abstract class AbstractSegmentStoreStatisticsViewer extends AbstractTmfTr
             checkNotNull(Messages.SegmentStoreStatistics_Statistics_MinLabel),
             checkNotNull(Messages.SegmentStoreStatistics_MaxLabel),
             checkNotNull(Messages.SegmentStoreStatistics_AverageLabel),
-            checkNotNull(Messages.SegmentStoreStatisticsViewer_StandardDeviation)
+            checkNotNull(Messages.SegmentStoreStatisticsViewer_StandardDeviation),
+            checkNotNull(Messages.SegmentStoreStatisticsViewer_Count)
     };
 
     /**
@@ -90,6 +91,8 @@ public abstract class AbstractSegmentStoreStatisticsViewer extends AbstractTmfTr
                         value = String.valueOf(toFormattedString(entry.getEntry().getAverage()));
                     } else if (columnIndex == 4) {
                         value = String.valueOf(toFormattedString(entry.getEntry().getStdDev()));
+                    } else if (columnIndex == 5) {
+                        value = String.valueOf(entry.getEntry().getNbSegments());
                     }
                 }
             }
@@ -208,6 +211,23 @@ public abstract class AbstractSegmentStoreStatisticsViewer extends AbstractTmfTr
                     }
                 });
                 columns.add(column);
+                column = new TmfTreeColumnData(COLUMN_NAMES[5]);
+                column.setAlignment(SWT.RIGHT);
+                column.setComparator(new ViewerComparator() {
+                    @Override
+                    public int compare(@Nullable Viewer viewer, @Nullable Object e1, @Nullable Object e2) {
+                        if ((e1 == null) || (e2 == null)) {
+                            return 0;
+                        }
+
+                        SegmentStoreStatisticsEntry n1 = (SegmentStoreStatisticsEntry) e1;
+                        SegmentStoreStatisticsEntry n2 = (SegmentStoreStatisticsEntry) e2;
+
+                        return Long.compare(n1.getEntry().getNbSegments(), n2.getEntry().getNbSegments());
+
+                    }
+                });
+                columns.add(column);
                 column = new TmfTreeColumnData(""); //$NON-NLS-1$
                 columns.add(column);
                 return columns;
index 9752956a281031dbb2b7de30809ae5cdbd29c76b..b18ddbee66abe6e358a038f97f15399c6b4099a3 100644 (file)
@@ -32,6 +32,9 @@ public class Messages extends NLS {
     public static String SegmentStoreStatistics_MaxLabel;
     /** Name of average column */
     public static String SegmentStoreStatistics_AverageLabel;
+    /** Name of count column */
+    public static String SegmentStoreStatisticsViewer_Count;
+
     /** Name of average column */
     public static String SegmentStoreStatisticsViewer_StandardDeviation;
 
index 61c5df5f207d2977096d4090baa570bb3001a1eb..682eb7b5dda36ae15469cbf70ba4f1ff9b946ed8 100644 (file)
@@ -13,4 +13,5 @@ SegmentStoreStatistics_LevelLabel=Level
 SegmentStoreStatistics_Statistics_MinLabel=Minimum
 SegmentStoreStatistics_MaxLabel=Maximum
 SegmentStoreStatistics_AverageLabel=Average
+SegmentStoreStatisticsViewer_Count=Count
 SegmentStoreStatisticsViewer_StandardDeviation=Standard Deviation
\ No newline at end of file
This page took 0.025957 seconds and 5 git commands to generate.