[Title]chart tooltip update
authoryeongtaik.byeon <yeongtaik.byeon@samsung.com>
Fri, 17 Aug 2012 07:41:11 +0000 (16:41 +0900)
committeryeongtaik.byeon <yeongtaik.byeon@samsung.com>
Fri, 17 Aug 2012 07:41:11 +0000 (16:41 +0900)
[Type]update
[Module]timeline chart
[Priority]normal
[CQ#]
[Redmine#]6438
[Problem]
[Cause]
[Solution]
[TestCase]

13 files changed:
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DACustomChartRenderer.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DACustomChartSeries.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DACustomChartSeriesItem.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TimelineChartLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TimelineChartLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DACPUChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DACPUCoreChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DACPUFrequencyChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAFileChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAHeapChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAProcessMemoryChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DASystemMemoryChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/tables/StatsTable.java

index cba6e6d..12e0a0f 100644 (file)
@@ -149,8 +149,11 @@ public class DACustomChartRenderer {
                                                .get(index).getY();
                                double xVal = series.getSeriesItemList()
                                                .get(index).getX();
-                               text = series.getName() + ":" + yVal
-                                               + series.getSeriesUnit();
+//                             text = series.getName() + ":" + yVal
+//                                             + series.getSeriesUnit();
+                               text = series.getName() + " : " + series.getSeriesItemList()
+                                               .get(index).getTooltipText();
+//                             System.out.println(series.getName()+" yVal : " + yVal);
                                
                                gc.setForeground(tooltip.getLineColor());
                                gc.setLineStyle(SWT.LINE_DOT);
index 0a3ea7d..d561493 100644 (file)
@@ -38,7 +38,6 @@ public class DACustomChartSeries {
        private double barWidth = SERIES_DEFAULT_BAR_WIDTH;
        private double maxX = 0;
        private double maxY = 0;
-       private String seriesUnit = "";
 
        public DACustomChartSeries(String name, int chartStyle) {
                this.name = name;
@@ -102,14 +101,6 @@ public class DACustomChartSeries {
        public double getMaxY() {
                return maxY;
        }
-
-       public String getSeriesUnit() {
-               return seriesUnit;
-       }
-
-       public void setSeriesUnit(String seriesUnit) {
-               this.seriesUnit = seriesUnit;
-       }
        
        public int getPrevIndexByXvalue(double x){
                int current;
index 57e106c..cb5b8b6 100644 (file)
@@ -25,16 +25,30 @@ public class DACustomChartSeriesItem {
        private double y = 0;
        private double barWidth = -1;
        private Color eventColor = null;
+       private String tooltipText;
 
        public DACustomChartSeriesItem(double x, double y) {
-               this.setX(x);
-               this.setY(y);
+               this.x = x;
+               this.y = y;
        }
 
        public DACustomChartSeriesItem(double x, double y, Color eventColor) {
-               this.setX(x);
-               this.setY(y);
-               this.setEventColor(eventColor);
+               this.x = x;
+               this.y = y;
+               this.eventColor = eventColor;
+       }
+       
+       public DACustomChartSeriesItem(double x, double y, String tooltipText) {
+               this.x = x;
+               this.y = y;
+               this.tooltipText = tooltipText;
+       }
+       
+       public DACustomChartSeriesItem(double x, double y, Color eventColor, String tooltipText) {
+               this.x = x;
+               this.y = y;
+               this.eventColor = eventColor;
+               this.tooltipText = tooltipText;
        }
 
        public double getX() {
@@ -68,4 +82,12 @@ public class DACustomChartSeriesItem {
        public void setEventColor(Color eventColor) {
                this.eventColor = eventColor;
        }
+
+       public String getTooltipText() {
+               return tooltipText;
+       }
+
+       public void setTooltipText(String tooltipText) {
+               this.tooltipText = tooltipText;
+       }
 }
index b622c86..e207c24 100644 (file)
@@ -57,6 +57,12 @@ public class TimelineChartLabels extends NLS {
        
        public static String TIMELINE_TICK_ADD;
        
+       public static String UNIT_PERCENTAGE;
+       public static String UNIT_GHZ;
+       public static String UNIT_MB;
+       public static String UNIT_BYTE;
+       
+       
        static {
                // initialize resource bundle
                NLS.initializeMessages(BUNDLE_NAME, TimelineChartLabels.class);
index f9da867..4baea41 100644 (file)
@@ -55,7 +55,7 @@ public class DACPUChart extends DATimelineChart {
 
                appLoadSeries = new DACustomChartSeries(
                                TimelineChartLabels.CPU_CHART_SERIES_NAME_APP_LOAD,
-                               DACustomChartSeries.SERIES_STYLE_LINE,
+                               DACustomChartSeries.SERIES_STYLE_AREA,
                                ColorResources.SERIESE_COLOR_CPU_SYSTEM);
                totalLoadSeries = new DACustomChartSeries(
                                TimelineChartLabels.CPU_CHART_SERIES_NAME_TOTAL_LOAD,
@@ -133,7 +133,8 @@ public class DACPUChart extends DATimelineChart {
                        }
 
                        appLoadSeries.addSeriesItem(new DACustomChartSeriesItem(time,
-                                       appCpuRate));
+                                       appCpuRate, String.valueOf(appCpuRate)
+                                                       + TimelineChartLabels.UNIT_PERCENTAGE));
 
                        // FIXME
                        /* for file chart */
@@ -165,10 +166,9 @@ public class DACPUChart extends DATimelineChart {
                                e.printStackTrace();
                        }
 
-                       // totalLoadInfo.newXYDataItems.add(new XYDataItem(time,
-                       // systemAvgLoad));
                        totalLoadSeries.addSeriesItem(new DACustomChartSeriesItem(time,
-                                       systemAvgLoad));
+                                       systemAvgLoad, String.valueOf(systemAvgLoad)
+                                                       + TimelineChartLabels.UNIT_PERCENTAGE));
                }
        }
 
index b9137a0..af11035 100644 (file)
@@ -34,22 +34,22 @@ public class DACPUCoreChart extends DATimelineChart {
 
        public DACPUCoreChart() {
                chartName = TimelineChartLabels.CPU_CORE_CHART_TITLE;
-               /*core 0*/
+               /* core 0 */
                coreChartSeriesList.add(new DACustomChartSeries(
                                TimelineChartLabels.CPU_CORE_CHART_SERIES_NAME_CORE0,
                                DACustomChartSeries.SERIES_STYLE_LINE,
                                ColorResources.SERIESE_COLOR_CPUCORE_CORE0));
-               /*core 1*/
+               /* core 1 */
                coreChartSeriesList.add(new DACustomChartSeries(
                                TimelineChartLabels.CPU_CORE_CHART_SERIES_NAME_CORE1,
                                DACustomChartSeries.SERIES_STYLE_LINE,
                                ColorResources.SERIESE_COLOR_CPUCORE_CORE1));
-               /*core 2*/
+               /* core 2 */
                coreChartSeriesList.add(new DACustomChartSeries(
                                TimelineChartLabels.CPU_CORE_CHART_SERIES_NAME_CORE2,
                                DACustomChartSeries.SERIES_STYLE_LINE,
                                ColorResources.SERIESE_COLOR_CPUCORE_CORE2));
-               /*core 3*/
+               /* core 3 */
                coreChartSeriesList.add(new DACustomChartSeries(
                                TimelineChartLabels.CPU_CORE_CHART_SERIES_NAME_CORE3,
                                DACustomChartSeries.SERIES_STYLE_LINE,
@@ -59,15 +59,16 @@ public class DACPUCoreChart extends DATimelineChart {
        @Override
        public DACustomChart createDAChart(Composite parent) {
                chart = new DACustomChart(parent, chartName);
-               
-               if(null == coreChartSeriesList || coreChartSeriesList.size() != DEFAULT_CORE_SIZE){
+
+               if (null == coreChartSeriesList
+                               || coreChartSeriesList.size() != DEFAULT_CORE_SIZE) {
                        return null;
                }
-               
-               for(int i=0; i<DEFAULT_CORE_SIZE; i++){
+
+               for (int i = 0; i < DEFAULT_CORE_SIZE; i++) {
                        chart.addSeries(coreChartSeriesList.get(i));
                }
-               
+
                setChartStyle();
                chart.getPlot().setAutoHeightRange(false);
                chart.getPlot().setAxisRangeY(0, 101);
@@ -100,11 +101,11 @@ public class DACPUCoreChart extends DATimelineChart {
 
        @Override
        public void clear() {
-               if(null == coreChartSeriesList){
+               if (null == coreChartSeriesList) {
                        return;
                }
-               
-               for(int i=0; i<coreChartSeriesList.size(); i++){
+
+               for (int i = 0; i < coreChartSeriesList.size(); i++) {
                        coreChartSeriesList.get(i).clear();
                }
        }
@@ -114,23 +115,36 @@ public class DACPUCoreChart extends DATimelineChart {
                // TODO Auto-generated method stub
 
        }
+
        private void parsingLog(List<String> log) {
                if (null == log || 0 > log.size()) {
                        return;
                }
-               
-               if (!log.get(LogCenterConstants.DEVICE_SYSTEM_CPU_USAGE_INDEX).isEmpty()) {
+
+               if (!log.get(LogCenterConstants.DEVICE_SYSTEM_CPU_USAGE_INDEX)
+                               .isEmpty()) {
                        long time = 0;
-                       
+
                        try {
-                               time = TimelineUtils.transformLogTimeIntoTimelineTime(Double.parseDouble(log.get(LogCenterConstants.DEVICE_TIME_INDEX))) / TimelineConstants.TIME_US_TO_MS / TimelineConstants.TIME_US_TO_MS;
-                               String[] cpuRates = log.get(LogCenterConstants.DEVICE_SYSTEM_CPU_USAGE_INDEX).split(","); //$NON-NLS-1$
-                               if(coreSize == TempConstants.NOT_INITED) {
+                               time = TimelineUtils.transformLogTimeIntoTimelineTime(Double
+                                               .parseDouble(log
+                                                               .get(LogCenterConstants.DEVICE_TIME_INDEX)))
+                                               / TimelineConstants.TIME_US_TO_MS
+                                               / TimelineConstants.TIME_US_TO_MS;
+                               String[] cpuRates = log.get(
+                                               LogCenterConstants.DEVICE_SYSTEM_CPU_USAGE_INDEX)
+                                               .split(","); //$NON-NLS-1$
+                               double value = 0;
+                               if (coreSize == TempConstants.NOT_INITED) {
                                        coreSize = cpuRates.length - 1;
                                }
-                               
-                               for(int i = 0; i < coreSize; i++) {
-                                       coreChartSeriesList.get(i).addSeriesItem(new DACustomChartSeriesItem(time, Double.parseDouble(cpuRates[i])));
+
+                               for (int i = 0; i < coreSize; i++) {
+                                       value = Double.parseDouble(cpuRates[i]);
+                                       coreChartSeriesList.get(i).addSeriesItem(
+                                                       new DACustomChartSeriesItem(time, value, String
+                                                                       .valueOf(value)
+                                                                       + TimelineChartLabels.UNIT_PERCENTAGE));
                                }
                        } catch (NumberFormatException ne) {
                                ne.printStackTrace();
@@ -141,6 +155,7 @@ public class DACPUCoreChart extends DATimelineChart {
                        }
                }
        }
+
        @Override
        public void parsingLogPackage(LogPackage logPack, int probeType) {
                if (!isAbleToParse(logPack, probeType)) {
@@ -153,7 +168,7 @@ public class DACPUCoreChart extends DATimelineChart {
                        parsingLog(logs.get(i));
                }
        }
-       
+
        public int getCoreSize() {
                return coreSize;
        }
index afac34a..1ba7aaa 100644 (file)
@@ -25,11 +25,15 @@ import java.util.List;
 import org.eclipse.swt.widgets.Composite;
 import org.jfree.data.xy.XYSeries;
 import org.tizen.dynamicanalyzer.ColorResources;
+import org.tizen.dynamicanalyzer.constants.LogCenterConstants;
 import org.tizen.dynamicanalyzer.constants.TimelineConstants;
 import org.tizen.dynamicanalyzer.model.LogPackage;
+import org.tizen.dynamicanalyzer.model.Logs;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.utils.TimelineUtils;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeriesItem;
 
 public class DACPUFrequencyChart extends DATimelineChart {
        private static DACPUFrequencyChart instance = null;
@@ -58,9 +62,9 @@ public class DACPUFrequencyChart extends DATimelineChart {
                chart = new DACustomChart(parent, chartName);
 
                chart.addSeries(frequencySeries);
-               
+
                setChartStyle();
-               
+
                return chart;
        }
 
@@ -100,8 +104,54 @@ public class DACPUFrequencyChart extends DATimelineChart {
 
        @Override
        public void parsingLogPackage(LogPackage logPack, int probeType) {
-               // TODO Auto-generated method stub
+               if (!isAbleToParse(logPack, probeType)) {
+                       return;
+               }
 
+               Logs logs = logPack.getLogs(probeType);
+               List<List<String>> logList = logs.getLogs();
+               for (int i = 0; i < logList.size(); i++) {
+                       parsingLog(logList.get(i));
+               }
        }
 
+       private void parsingLog(List<String> log) {
+               if (null == log || 0 > log.size()) {
+                       return;
+               }
+
+               if (!log.get(LogCenterConstants.DEVICE_CPU_FREQUENCY_INDEX).isEmpty()) {
+                       long time = 0;
+                       double freq0 = 0;
+
+                       try {
+                               time = TimelineUtils.transformLogTimeIntoTimelineTime(Double
+                                               .parseDouble(log
+                                                               .get(LogCenterConstants.DEVICE_TIME_INDEX)))
+                                               / TimelineConstants.TIME_US_TO_MS
+                                               / TimelineConstants.TIME_US_TO_MS;
+                               String[] cpuFreqs = log.get(
+                                               LogCenterConstants.DEVICE_CPU_FREQUENCY_INDEX).split(
+                                               ","); //$NON-NLS-1$
+
+                               freq0 = Double
+                                               .parseDouble(String.format(
+                                                               "%.2f",
+                                                               Double.parseDouble(cpuFreqs[0])
+                                                                               / (double) (TimelineConstants.BYTE_TO_KBYTE * TimelineConstants.BYTE_TO_KBYTE)));
+                       } catch (NumberFormatException ne) {
+                               ne.printStackTrace();
+                       } catch (NullPointerException ne) {
+                               ne.printStackTrace();
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+
+                       frequencySeries
+                                       .addSeriesItem(new DACustomChartSeriesItem(time, freq0,
+                                                       String.valueOf(freq0)
+                                                                       + TimelineChartLabels.UNIT_GHZ));
+
+               }
+       }
 }
index 3c6c5e7..856e248 100644 (file)
@@ -33,11 +33,11 @@ import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeries;
 
 public class DAFileChart extends DATimelineChart {
        private static DAFileChart instance = null;
-       
+
        private DACustomChartSeries readSeries;
        private DACustomChartSeries writeSeries;
        private DACustomChartSeries fdCountSeries;
-       
+
        public static DAFileChart getInstance() {
                if (instance == null) {
                        instance = new DAFileChart();
@@ -45,11 +45,11 @@ public class DAFileChart extends DATimelineChart {
 
                return instance;
        }
-       
+
        private DAFileChart() {
                chartType = TimelineConstants.CHART_TYPE_FILE;
                chartName = TimelineChartLabels.FILE_CHART_TITLE;
-               
+
                readSeries = new DACustomChartSeries(
                                TimelineChartLabels.FILE_CHART_SERIES_NAME_READ,
                                DACustomChartSeries.SERIES_STYLE_BAR,
@@ -62,8 +62,9 @@ public class DAFileChart extends DATimelineChart {
                                TimelineChartLabels.FILE_CHART_SERIES_NAME_FD_COUNT,
                                DACustomChartSeries.SERIES_STYLE_LINE,
                                ColorResources.SERIESE_COLOR_FILE_FD);
+
        }
-               
+
        @Override
        public DACustomChart createDAChart(Composite parent) {
                chart = new DACustomChart(parent, chartName);
index b8ed8a8..6868d2a 100644 (file)
 package org.tizen.dynamicanalyzer.timeline.chart;
 
 import java.awt.Color;
+import java.util.HashMap;
 import java.util.List;
 
 import org.eclipse.swt.widgets.Composite;
 import org.jfree.data.xy.XYSeries;
 import org.tizen.dynamicanalyzer.ColorResources;
+import org.tizen.dynamicanalyzer.constants.LogCenterConstants;
 import org.tizen.dynamicanalyzer.constants.TimelineConstants;
 import org.tizen.dynamicanalyzer.model.LogPackage;
+import org.tizen.dynamicanalyzer.model.Logs;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.utils.TimelineUtils;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeriesItem;
 
 public class DAHeapChart extends DATimelineChart {
        private static DAHeapChart instance = null;
-       
+       private final String NIL = "(nil)"; //$NON-NLS-1$
+
        private DACustomChartSeries totalAllocationSeries;
        private DACustomChartSeries userAllocationSeries;
-       
+       private double allocByte = 0;
+       private HashMap<String, Double> allocationSeriesDataSetMap = new HashMap<String, Double>();
+
        public static DAHeapChart getInstance() {
                if (instance == null) {
                        instance = new DAHeapChart();
@@ -44,7 +52,7 @@ public class DAHeapChart extends DATimelineChart {
 
                return instance;
        }
-       
+
        private DAHeapChart() {
                chartType = TimelineConstants.CHART_TYPE_HEAP;
                chartName = TimelineChartLabels.HEAP_CHART_TITLE;
@@ -58,7 +66,7 @@ public class DAHeapChart extends DATimelineChart {
                                DACustomChartSeries.SERIES_STYLE_AREA,
                                ColorResources.SERIESE_COLOR_HEAP_USER);
        }
-       
+
        @Override
        public DACustomChart createDAChart(Composite parent) {
                chart = new DACustomChart(parent, chartName);
@@ -107,8 +115,172 @@ public class DAHeapChart extends DATimelineChart {
 
        @Override
        public void parsingLogPackage(LogPackage logPack, int probeType) {
-               // TODO Auto-generated method stub
+               if (!isAbleToParse(logPack, probeType)) {
+                       return;
+               }
+
+               Logs memoryLogs = logPack.getLogs(LogCenterConstants.LOG_MEMORY);
+               Logs deviceLogs = logPack.getLogs(LogCenterConstants.LOG_DEVICE);
+
+               List<List<String>> memoryLogList = memoryLogs == null ? null
+                               : memoryLogs.getLogs();
+               List<List<String>> deviceLogList = deviceLogs == null ? null
+                               : deviceLogs.getLogs();
+
+               parsingLog(memoryLogList, deviceLogList);
+       }
+
+       private void parsingLog(List<List<String>> memoryLogList,
+                       List<List<String>> deviceLogList) {
+               boolean isUserAllocUpdated = false;
+
+               /* user alloc */
+               if (memoryLogList != null) {
+                       int size = memoryLogList.size();
+                       for (int i = 0; i < size; i++) {
+                               List<String> log = memoryLogList.get(i);
+                               if (log != null && log.size() > 0) {
+                                       int memApiType = 0;
+                                       int internalFlag = 0;
+                                       int errorNo = 0;
+
+                                       try {
+                                               memApiType = Integer.parseInt(log
+                                                               .get(LogCenterConstants.MEMORY_APITYPE_INDEX));
+                                               internalFlag = Integer.parseInt(log
+                                                               .get(LogCenterConstants.INTERNAL_FLAG_INDEX));
+                                               errorNo = Integer.parseInt(log
+                                                               .get(LogCenterConstants.ERROR_INDEX));
+                                       } catch (NumberFormatException ne) {
+                                               ne.printStackTrace();
+                                       }
+
+                                       if (errorNo == 0
+                                                       && TimelineConstants.MEM_USER == internalFlag) {
+                                               if (TimelineConstants.MEM_API_TYPE_ALLOC == memApiType
+                                                               || TimelineConstants.MEM_API_TYPE_FREE == memApiType
+                                                               || TimelineConstants.MEM_API_TYPE_MANAGE == memApiType) {
+                                                       long time = 0;
+                                                       try {
+                                                               time = TimelineUtils
+                                                                               .transformLogTimeIntoTimelineTime(Double.parseDouble(log
+                                                                                               .get(LogCenterConstants.TIME_INDEX)))
+                                                                               / TimelineConstants.TIME_US_TO_MS
+                                                                               / TimelineConstants.TIME_US_TO_MS;
+                                                       } catch (NumberFormatException ne) {
+                                                               ne.printStackTrace();
+                                                       } catch (NullPointerException ne) {
+                                                               ne.printStackTrace();
+                                                       } catch (Exception e) {
+                                                               e.printStackTrace();
+                                                       }
 
+                                                       isUserAllocUpdated = addNewSeriesUserAllocData(
+                                                                       memApiType, time, log);
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               /* total alloc */
+               if (deviceLogList != null) {
+                       int size = deviceLogList.size();
+                       for (int i = 0; i < size; i++) {
+                               List<String> log = deviceLogList.get(i);
+                               if (log != null && log.size() > 0) {
+                                       if (!log.get(
+                                                       LogCenterConstants.DEVICE_ALLOCATION_SIZE_INDEX)
+                                                       .isEmpty()) {
+                                               long time = 0;
+                                               double value = 0;
+                                               double valueTooltip = 0;
+
+                                               try {
+                                                       time = TimelineUtils
+                                                                       .transformLogTimeIntoTimelineTime(Double.parseDouble(log
+                                                                                       .get(LogCenterConstants.DEVICE_TIME_INDEX)))
+                                                                       / TimelineConstants.TIME_US_TO_MS
+                                                                       / TimelineConstants.TIME_US_TO_MS;
+                                                       value = Double
+                                                                       .parseDouble(String.format(
+                                                                                       "%.2f",
+                                                                                       (Double.parseDouble(log
+                                                                                                       .get(LogCenterConstants.DEVICE_SYSTEM_USED_MEMORY_INDEX)) - allocByte)));
+                                                       valueTooltip = Double
+                                                                       .parseDouble(String.format(
+                                                                                       "%.2f",
+                                                                                       (Double.parseDouble(log
+                                                                                                       .get(LogCenterConstants.DEVICE_SYSTEM_USED_MEMORY_INDEX)) - allocByte)
+                                                                                                       / (double) (TimelineConstants.BYTE_TO_KBYTE * TimelineConstants.BYTE_TO_KBYTE)));
+                                               } catch (NumberFormatException ne) {
+                                                       ne.printStackTrace();
+                                               } catch (NullPointerException ne) {
+                                                       ne.printStackTrace();
+                                               } catch (Exception e) {
+                                                       e.printStackTrace();
+                                               }
+                                               totalAllocationSeries
+                                                               .addSeriesItem(new DACustomChartSeriesItem(
+                                                                               time, value, String
+                                                                                               .valueOf(valueTooltip)
+                                                                                               + TimelineChartLabels.UNIT_MB));
+                                               // totalAllocationSeriesDataSet.newXYDataItems.add(new
+                                               // XYDataItem(time, value));
+
+                                               if (!isUserAllocUpdated) {
+                                                       // userAllocationSeriesDataSet.newXYDataItems.add(new
+                                                       // XYDataItem(time, allocByte));
+                                                       userAllocationSeries
+                                                                       .addSeriesItem(new DACustomChartSeriesItem(
+                                                                                       time,
+                                                                                       allocByte,
+                                                                                       String.valueOf(allocByte)
+                                                                                                       + TimelineChartLabels.UNIT_BYTE));
+                                               }
+                                       }
+                               }
+                       }
+               }
        }
 
+       private boolean addNewSeriesUserAllocData(int fdApiType, long time,
+                       List<String> log) {
+               double size = 0;
+
+               String addressString = log.get(LogCenterConstants.MEMORY_ADDR_INDEX);
+               if (addressString.equals(NIL)) {
+                       return false;
+               }
+
+               if (TimelineConstants.MEM_API_TYPE_ALLOC == fdApiType) {
+                       if (log.get(LogCenterConstants.MEMORY_SIZE_INDEX).isEmpty()) {
+                               return false;
+                       }
+
+                       try {
+                               size = Double.parseDouble(log
+                                               .get(LogCenterConstants.MEMORY_SIZE_INDEX));
+                       } catch (NumberFormatException ne) {
+                               ne.printStackTrace();
+                       }
+
+                       allocByte += size;
+                       allocationSeriesDataSetMap.put(addressString, size);
+               } else if (TimelineConstants.MEM_API_TYPE_FREE == fdApiType) {
+                       if (!allocationSeriesDataSetMap.containsKey(addressString)) {
+                               return false;
+                       }
+                       size = allocationSeriesDataSetMap.get(addressString);
+
+                       allocByte -= size;
+               }
+               userAllocationSeries.addSeriesItem(new DACustomChartSeriesItem(time,
+                               allocByte, String.valueOf(allocByte)
+                                               + TimelineChartLabels.UNIT_BYTE));
+               // userAllocationSeriesDataSet.newXYDataItems.add(new XYDataItem(time,
+               // allocByte));
+
+               return true;
+       }
 }
index 15d0653..7643639 100644 (file)
@@ -25,19 +25,23 @@ import java.util.List;
 import org.eclipse.swt.widgets.Composite;
 import org.jfree.data.xy.XYSeries;
 import org.tizen.dynamicanalyzer.ColorResources;
+import org.tizen.dynamicanalyzer.constants.LogCenterConstants;
 import org.tizen.dynamicanalyzer.constants.TimelineConstants;
 import org.tizen.dynamicanalyzer.model.LogPackage;
+import org.tizen.dynamicanalyzer.model.Logs;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.utils.TimelineUtils;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeriesItem;
 
 public class DAProcessMemoryChart extends DATimelineChart {
        private static DAProcessMemoryChart instance = null;
-       
+
        private DACustomChartSeries VSSMemorySeries;
        private DACustomChartSeries RSSMemorySeries;
        private DACustomChartSeries PSSMemorySeries;
-       
+
        public static DAProcessMemoryChart getInstance() {
                if (instance == null) {
                        instance = new DAProcessMemoryChart();
@@ -45,25 +49,25 @@ public class DAProcessMemoryChart extends DATimelineChart {
 
                return instance;
        }
-       
+
        private DAProcessMemoryChart() {
                chartType = TimelineConstants.CHART_TYPE_PROCESS_MEMORY;
                chartName = TimelineChartLabels.PROCESS_MEMORY_CHART_TITLE;
-               
-               VSSMemorySeries  = new DACustomChartSeries(
+
+               VSSMemorySeries = new DACustomChartSeries(
                                TimelineChartLabels.PROCESS_MEMORY_CHART_VSS,
                                DACustomChartSeries.SERIES_STYLE_AREA,
                                ColorResources.SERIESE_COLOR_PROCESS_VSS);
-               RSSMemorySeries  = new DACustomChartSeries(
+               RSSMemorySeries = new DACustomChartSeries(
                                TimelineChartLabels.PROCESS_MEMORY_CHART_RSS,
                                DACustomChartSeries.SERIES_STYLE_AREA,
                                ColorResources.SERIESE_COLOR_PROCESS_RSS);
-               PSSMemorySeries  = new DACustomChartSeries(
+               PSSMemorySeries = new DACustomChartSeries(
                                TimelineChartLabels.PROCESS_MEMORY_CHART_PSS,
                                DACustomChartSeries.SERIES_STYLE_AREA,
                                ColorResources.SERIESE_COLOR_PROCESS_PSS);
        }
-               
+
        @Override
        public DACustomChart createDAChart(Composite parent) {
                chart = new DACustomChart(parent, chartName);
@@ -114,8 +118,109 @@ public class DAProcessMemoryChart extends DATimelineChart {
 
        @Override
        public void parsingLogPackage(LogPackage logPack, int probeType) {
-               // TODO Auto-generated method stub
+               if (!isAbleToParse(logPack, probeType)) {
+                       return;
+               }
 
+               Logs logs = logPack.getLogs(probeType);
+               List<List<String>> logList = logs.getLogs();
+               for (int i = 0; i < logList.size(); i++) {
+                       parsingLog(logList.get(i));
+               }
        }
 
+       private void parsingLog(List<String> log) {
+               if (null == log || 0 > log.size()) {
+                       return;
+               }
+
+               /* VSS */
+               if (!log.get(LogCenterConstants.DEVICE_VSS_MEMORY_INDEX).isEmpty()) {
+                       long time = 0;
+                       double value = 0;
+
+                       try {
+                               time = TimelineUtils.transformLogTimeIntoTimelineTime(Double
+                                               .parseDouble(log
+                                                               .get(LogCenterConstants.DEVICE_TIME_INDEX)))
+                                               / TimelineConstants.TIME_US_TO_MS
+                                               / TimelineConstants.TIME_US_TO_MS;
+                               value = Double
+                                               .parseDouble(String.format(
+                                                               "%.2f",
+                                                               Double.parseDouble(log
+                                                                               .get(LogCenterConstants.DEVICE_VSS_MEMORY_INDEX))
+                                                                               / (double) (TimelineConstants.BYTE_TO_KBYTE * TimelineConstants.BYTE_TO_KBYTE)));
+                       } catch (NumberFormatException ne) {
+                               ne.printStackTrace();
+                       } catch (NullPointerException ne) {
+                               ne.printStackTrace();
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+
+                       VSSMemorySeries
+                                       .addSeriesItem(new DACustomChartSeriesItem(time, value,
+                                                       String.valueOf(value) + TimelineChartLabels.UNIT_MB));
+
+               }
+
+               /* RSS */
+               if (!log.get(LogCenterConstants.DEVICE_RSS_MEMORY_INDEX).isEmpty()) {
+                       long time = 0;
+                       double value = 0;
+
+                       try {
+                               time = Long.parseLong(log
+                                               .get(LogCenterConstants.DEVICE_TIME_INDEX))
+                                               / TimelineConstants.TIME_US_TO_MS
+                                               / TimelineConstants.TIME_US_TO_MS;
+                               value = Double
+                                               .parseDouble(String.format(
+                                                               "%.2f",
+                                                               Double.parseDouble(log
+                                                                               .get(LogCenterConstants.DEVICE_RSS_MEMORY_INDEX))
+                                                                               / (double) (TimelineConstants.BYTE_TO_KBYTE * TimelineConstants.BYTE_TO_KBYTE)));
+                       } catch (NumberFormatException ne) {
+                               ne.printStackTrace();
+                       } catch (NullPointerException ne) {
+                               ne.printStackTrace();
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+
+                       RSSMemorySeries
+                                       .addSeriesItem(new DACustomChartSeriesItem(time, value,
+                                                       String.valueOf(value) + TimelineChartLabels.UNIT_MB));
+               }
+
+               /* PSS */
+               if (!log.get(LogCenterConstants.DEVICE_PSS_MEMORY_INDEX).isEmpty()) {
+                       long time = 0;
+                       double value = 0;
+
+                       try {
+                               time = Long.parseLong(log
+                                               .get(LogCenterConstants.DEVICE_TIME_INDEX))
+                                               / TimelineConstants.TIME_US_TO_MS
+                                               / TimelineConstants.TIME_US_TO_MS;
+                               value = Double
+                                               .parseDouble(String.format(
+                                                               "%.2f",
+                                                               Double.parseDouble(log
+                                                                               .get(LogCenterConstants.DEVICE_PSS_MEMORY_INDEX))
+                                                                               / (double) (TimelineConstants.BYTE_TO_KBYTE * TimelineConstants.BYTE_TO_KBYTE)));
+                       } catch (NumberFormatException ne) {
+                               ne.printStackTrace();
+                       } catch (NullPointerException ne) {
+                               ne.printStackTrace();
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+
+                       PSSMemorySeries
+                                       .addSeriesItem(new DACustomChartSeriesItem(time, value,
+                                                       String.valueOf(value) + TimelineChartLabels.UNIT_MB));
+               }
+       }
 }
index cb512b5..1a3cfda 100644 (file)
@@ -25,19 +25,24 @@ import java.util.List;
 import org.eclipse.swt.widgets.Composite;
 import org.jfree.data.xy.XYSeries;
 import org.tizen.dynamicanalyzer.ColorResources;
+import org.tizen.dynamicanalyzer.constants.LogCenterConstants;
 import org.tizen.dynamicanalyzer.constants.TimelineConstants;
 import org.tizen.dynamicanalyzer.model.LogPackage;
+import org.tizen.dynamicanalyzer.model.Logs;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.timeline.TempConstants;
+import org.tizen.dynamicanalyzer.utils.TimelineUtils;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeriesItem;
 
 public class DASystemMemoryChart extends DATimelineChart {
        private static DASystemMemoryChart instance = null;
-       
+
        private DACustomChartSeries processSeries;
        private DACustomChartSeries systemSeries;
        private DACustomChartSeries totalSeries;
-       
+
        public static DASystemMemoryChart getInstance() {
                if (instance == null) {
                        instance = new DASystemMemoryChart();
@@ -45,11 +50,11 @@ public class DASystemMemoryChart extends DATimelineChart {
 
                return instance;
        }
-       
+
        private DASystemMemoryChart() {
                chartType = TimelineConstants.CHART_TYPE_SYSTEM_MEMORY;
                chartName = TimelineChartLabels.SYSTEM_MEMORY_CHART_TITLE;
-               
+
                processSeries = new DACustomChartSeries(
                                TimelineChartLabels.SYSTEM_MEMORY_CHART_SERIES_NAME_PROC_RESIDENT,
                                DACustomChartSeries.SERIES_STYLE_AREA,
@@ -63,17 +68,17 @@ public class DASystemMemoryChart extends DATimelineChart {
                                DACustomChartSeries.SERIES_STYLE_AREA,
                                ColorResources.SERIESE_COLOR_MEMORY_SYS_MAX);
        }
-       
+
        @Override
        public DACustomChart createDAChart(Composite parent) {
                chart = new DACustomChart(parent, chartName);
 
-               chart.addSeries(processSeries);
-               chart.addSeries(systemSeries);
                chart.addSeries(totalSeries);
+               chart.addSeries(systemSeries);
+               chart.addSeries(processSeries);
 
                setChartStyle();
-               
+
                return chart;
        }
 
@@ -115,8 +120,86 @@ public class DASystemMemoryChart extends DATimelineChart {
 
        @Override
        public void parsingLogPackage(LogPackage logPack, int probeType) {
-               // TODO Auto-generated method stub
+               if (!isAbleToParse(logPack, probeType)) {
+                       return;
+               }
 
+               Logs logs = logPack.getLogs(probeType);
+               List<List<String>> logList = logs.getLogs();
+               for (int i = 0; i < logList.size(); i++) {
+                       parsingLog(logList.get(i));
+               }
        }
 
+       private void parsingLog(List<String> log) {
+               if (null == log || 0 > log.size()) {
+                       return;
+               }
+
+               /* process */
+               if (!log.get(LogCenterConstants.DEVICE_RSS_MEMORY_INDEX).isEmpty()) {
+                       long time = 0;
+                       double usage = 0;
+
+                       try {
+                               time = TimelineUtils.transformLogTimeIntoTimelineTime(Double
+                                               .parseDouble(log
+                                                               .get(LogCenterConstants.DEVICE_TIME_INDEX)))
+                                               / TimelineConstants.TIME_US_TO_MS
+                                               / TimelineConstants.TIME_US_TO_MS;
+                               usage = Double
+                                               .parseDouble(String.format(
+                                                               "%.2f",
+                                                               Double.parseDouble(log
+                                                                               .get(LogCenterConstants.DEVICE_RSS_MEMORY_INDEX))
+                                                                               / (double) (TimelineConstants.BYTE_TO_KBYTE * TimelineConstants.BYTE_TO_KBYTE)));
+                       } catch (NumberFormatException ne) {
+                               ne.printStackTrace();
+                       } catch (NullPointerException ne) {
+                               ne.printStackTrace();
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+                       processSeries
+                                       .addSeriesItem(new DACustomChartSeriesItem(time, usage,
+                                                       String.valueOf(usage) + TimelineChartLabels.UNIT_MB));
+               }
+
+               /* system & total */
+               if (!log.get(LogCenterConstants.DEVICE_SYSTEM_USED_MEMORY_INDEX)
+                               .isEmpty()) {
+                       long time = 0;
+                       double usage = 0;
+                       double total = 0;
+                       try {
+                               time = TimelineUtils.transformLogTimeIntoTimelineTime(Double
+                                               .parseDouble(log
+                                                               .get(LogCenterConstants.DEVICE_TIME_INDEX)))
+                                               / TimelineConstants.TIME_US_TO_MS
+                                               / TimelineConstants.TIME_US_TO_MS;
+
+                               usage = Double
+                                               .parseDouble(String.format(
+                                                               "%.2f",
+                                                               Double.parseDouble(log
+                                                                               .get(LogCenterConstants.DEVICE_SYSTEM_USED_MEMORY_INDEX))
+                                                                               / (double) (TimelineConstants.BYTE_TO_KBYTE * TimelineConstants.BYTE_TO_KBYTE)));
+                               total = Double
+                                               .parseDouble(String
+                                                               .format("%.2f",
+                                                                               ((double) TempConstants.TOTAL_MEMORY / (double) (1024 * 1024))));
+
+                       } catch (NumberFormatException ne) {
+                               ne.printStackTrace();
+                       } catch (NullPointerException ne) {
+                               ne.printStackTrace();
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+                       systemSeries.addSeriesItem(new DACustomChartSeriesItem(time, usage,
+                                       String.valueOf(usage) + TimelineChartLabels.UNIT_MB));
+                       totalSeries.addSeriesItem(new DACustomChartSeriesItem(time, total,
+                                       String.valueOf(total) + TimelineChartLabels.UNIT_MB));
+               }
+       }
 }
index 2d34724..7af31c8 100644 (file)
@@ -30,6 +30,7 @@ import org.tizen.dynamicanalyzer.constants.TimelineConstants;
 import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
 import org.tizen.dynamicanalyzer.timeline.TimelineChartManager;
+import org.tizen.dynamicanalyzer.timeline.TimelineItemManager;
 import org.tizen.dynamicanalyzer.timeline.TimelineItemsProvider;
 import org.tizen.dynamicanalyzer.timeline.chart.TimelineChart;
 import org.tizen.dynamicanalyzer.ui.widgets.DATable.DATableComposite;
@@ -180,158 +181,161 @@ public class StatsTable extends DATableComposite {
                table.removeAll();
 
                insertStartEndTime();
-               List<TimelineChart> pItem = TimelineItemsProvider.getInstance().getSelectedChartList();
-               List<XYSeries> xySeries = null;
-               List<XYDataItem> xyDataItem = null;
-               double xVal;
-               double min = 0;
-               double max = 0;
-               double sum = 0;
-               double avr = 0;
-               double count = 0;
-               double start = 0;
-               double end = 0;
-               double val;
-               int itemID;
-
-               for (int i = 0; i < pItem.size(); i++) {
-                       itemID = pItem.get(i).getChartType();
-                       //FIXME : chart
-                       switch(itemID){
-                       case TimelineConstants.CHART_TYPE_CPU:
-                               continue;
-                       }
-                       xySeries = chartManager.getChartSeriesList(itemID);
-
-                       if (null == xySeries)
-                               continue;
+               if(false == TimelineItemManager.bCustomChart){
+                       List<TimelineChart> pItem = TimelineItemsProvider.getInstance().getSelectedChartList();
+                       List<XYSeries> xySeries = null;
+                       List<XYDataItem> xyDataItem = null;
+                       double xVal;
+                       double min = 0;
+                       double max = 0;
+                       double sum = 0;
+                       double avr = 0;
+                       double count = 0;
+                       double start = 0;
+                       double end = 0;
+                       double val;
+                       int itemID;
 
-                       for (int xySeriesCount = 0; xySeriesCount < xySeries.size(); xySeriesCount++) {
-                               XYSeries xys = xySeries.get(xySeriesCount);
-                               if (null == xys) {
+                       for (int i = 0; i < pItem.size(); i++) {
+                               itemID = pItem.get(i).getChartType();
+                               //FIXME : chart
+                               switch(itemID){
+                               case TimelineConstants.CHART_TYPE_CPU:
                                        continue;
                                }
-                               xyDataItem = xys.getItems();
-                               if (null == xyDataItem) {
+                               xySeries = chartManager.getChartSeriesList(itemID);
+
+                               if (null == xySeries)
                                        continue;
-                               }
 
-                               int startIndex = -1;
+                               for (int xySeriesCount = 0; xySeriesCount < xySeries.size(); xySeriesCount++) {
+                                       XYSeries xys = xySeries.get(xySeriesCount);
+                                       if (null == xys) {
+                                               continue;
+                                       }
+                                       xyDataItem = xys.getItems();
+                                       if (null == xyDataItem) {
+                                               continue;
+                                       }
 
-                               if (true == isIncludeRangeSet(itemID)) {
-                                       startIndex = getSelectionStartIndex(xyDataItem);
-                               }
+                                       int startIndex = -1;
 
-                               if (-1 == startIndex)
-                                       continue;
+                                       if (true == isIncludeRangeSet(itemID)) {
+                                               startIndex = getSelectionStartIndex(xyDataItem);
+                                       }
 
-                               for (int j = startIndex; j < xyDataItem.size(); j++) {
-                                       xVal = (xyDataItem.get(j).getX().doubleValue());
+                                       if (-1 == startIndex)
+                                               continue;
 
-                                       if (j == startIndex) {
-                                               val = xyDataItem.get(j).getY().doubleValue();
-                                               min = val;
-                                               max = val;
-                                               sum = val;
-                                               start = val;
-                                               end = val;
-                                               count = 1;
-                                       } else if (xVal * 1000000 > endTime)
-                                               break;
-                                       else {
-                                               val = xyDataItem.get(j).getY().doubleValue();
+                                       for (int j = startIndex; j < xyDataItem.size(); j++) {
+                                               xVal = (xyDataItem.get(j).getX().doubleValue());
 
-                                               if (val < min)
+                                               if (j == startIndex) {
+                                                       val = xyDataItem.get(j).getY().doubleValue();
                                                        min = val;
-                                               if (val > max)
                                                        max = val;
-                                               sum += val;
-                                               end = val;
-                                               count++;
+                                                       sum = val;
+                                                       start = val;
+                                                       end = val;
+                                                       count = 1;
+                                               } else if (xVal * 1000000 > endTime)
+                                                       break;
+                                               else {
+                                                       val = xyDataItem.get(j).getY().doubleValue();
+
+                                                       if (val < min)
+                                                               min = val;
+                                                       if (val > max)
+                                                               max = val;
+                                                       sum += val;
+                                                       end = val;
+                                                       count++;
+                                               }
                                        }
-                               }
 
-                               if (count != 0)
-                                       avr = (double) sum / (double) count;
+                                       if (count != 0)
+                                               avr = (double) sum / (double) count;
 
-                               String title = getTitleName(itemID, xys);
-                               if (null != title) {
-                                       switch (itemID) {
-                                       case TimelineConstants.CHART_TYPE_CPU:
-                                               insertRangeItem(title,
-                                                               Formatter.toPercentageFormat(start),
-                                                               Formatter.toPercentageFormat(end),
-                                                               Formatter.toPercentageFormat(avr),
-                                                               Formatter.toPercentageFormat(min),
-                                                               Formatter.toPercentageFormat(max));
-                                               break;
-                                       case TimelineConstants.CHART_TYPE_CPU_CORE:
-                                               insertRangeItem(title,
-                                                               Formatter.toPercentageFormat(start),
-                                                               Formatter.toPercentageFormat(end),
-                                                               Formatter.toPercentageFormat(avr),
-                                                               Formatter.toPercentageFormat(min),
-                                                               Formatter.toPercentageFormat(max));
-                                               break;
-                                       case TimelineConstants.CHART_TYPE_CPU_FREQUENCY:
-                                               insertRangeItem(title,
-                                                               Formatter.toHzFormat(start),
-                                                               Formatter.toHzFormat(end),
-                                                               Formatter.toHzFormat(avr),
-                                                               Formatter.toHzFormat(min),
-                                                               Formatter.toHzFormat(max));
-                                               break;
-                                       case TimelineConstants.CHART_TYPE_HEAP:
-                                               insertRangeItem(title, Formatter.toByteFormat(start),
-                                                               Formatter.toByteFormat(end),
-                                                               Formatter.toByteFormat(avr),
-                                                               Formatter.toByteFormat(min),
-                                                               Formatter.toByteFormat(max));
-                                               break;
-                                       case TimelineConstants.CHART_TYPE_PROCESS_MEMORY:
-                                               insertRangeItem(title, Formatter.toByteFormat(start),
-                                                               Formatter.toByteFormat(end),
-                                                               Formatter.toByteFormat((avr)),
-                                                               Formatter.toByteFormat(min),
-                                                               Formatter.toByteFormat(max));
-                                               break;
-                                       case TimelineConstants.CHART_TYPE_ENERGY:
-                                               insertRangeItem(title, Formatter.toNumberFormat(start),
-                                                               Formatter.toNumberFormat(end),
-                                                               Formatter.toNumberFormat(avr),
-                                                               Formatter.toNumberFormat(min),
-                                                               Formatter.toNumberFormat(max));
-                                               break;
-                                       case TimelineConstants.CHART_TYPE_FILE:
-                                               // File Count
-                                               if (xys.getKey().equals(TimelineChartLabels.FILE_CHART_SERIES_NAME_FD_COUNT)) {
+                                       String title = getTitleName(itemID, xys);
+                                       if (null != title) {
+                                               switch (itemID) {
+                                               case TimelineConstants.CHART_TYPE_CPU:
                                                        insertRangeItem(title,
-                                                                       Formatter.toNumberFormat(start),
-                                                                       Formatter.toNumberFormat(end),
-                                                                       Formatter.toDoubleFormat1(String
-                                                                                       .valueOf(avr)),
-                                                                       Formatter.toNumberFormat(min),
-                                                                       Formatter.toNumberFormat(max));
-                                               }
-                                               // File read, write
-                                               else {
+                                                                       Formatter.toPercentageFormat(start),
+                                                                       Formatter.toPercentageFormat(end),
+                                                                       Formatter.toPercentageFormat(avr),
+                                                                       Formatter.toPercentageFormat(min),
+                                                                       Formatter.toPercentageFormat(max));
+                                                       break;
+                                               case TimelineConstants.CHART_TYPE_CPU_CORE:
+                                                       insertRangeItem(title,
+                                                                       Formatter.toPercentageFormat(start),
+                                                                       Formatter.toPercentageFormat(end),
+                                                                       Formatter.toPercentageFormat(avr),
+                                                                       Formatter.toPercentageFormat(min),
+                                                                       Formatter.toPercentageFormat(max));
+                                                       break;
+                                               case TimelineConstants.CHART_TYPE_CPU_FREQUENCY:
                                                        insertRangeItem(title,
-                                                                       Formatter.toByteFormat(start),
+                                                                       Formatter.toHzFormat(start),
+                                                                       Formatter.toHzFormat(end),
+                                                                       Formatter.toHzFormat(avr),
+                                                                       Formatter.toHzFormat(min),
+                                                                       Formatter.toHzFormat(max));
+                                                       break;
+                                               case TimelineConstants.CHART_TYPE_HEAP:
+                                                       insertRangeItem(title, Formatter.toByteFormat(start),
+                                                                       Formatter.toByteFormat(end),
+                                                                       Formatter.toByteFormat(avr),
+                                                                       Formatter.toByteFormat(min),
+                                                                       Formatter.toByteFormat(max));
+                                                       break;
+                                               case TimelineConstants.CHART_TYPE_PROCESS_MEMORY:
+                                                       insertRangeItem(title, Formatter.toByteFormat(start),
                                                                        Formatter.toByteFormat(end),
-                                                                       Formatter.toBpsFormat(sum, startTime,
-                                                                                       endTime),
+                                                                       Formatter.toByteFormat((avr)),
                                                                        Formatter.toByteFormat(min),
                                                                        Formatter.toByteFormat(max));
+                                                       break;
+                                               case TimelineConstants.CHART_TYPE_ENERGY:
+                                                       insertRangeItem(title, Formatter.toNumberFormat(start),
+                                                                       Formatter.toNumberFormat(end),
+                                                                       Formatter.toNumberFormat(avr),
+                                                                       Formatter.toNumberFormat(min),
+                                                                       Formatter.toNumberFormat(max));
+                                                       break;
+                                               case TimelineConstants.CHART_TYPE_FILE:
+                                                       // File Count
+                                                       if (xys.getKey().equals(TimelineChartLabels.FILE_CHART_SERIES_NAME_FD_COUNT)) {
+                                                               insertRangeItem(title,
+                                                                               Formatter.toNumberFormat(start),
+                                                                               Formatter.toNumberFormat(end),
+                                                                               Formatter.toDoubleFormat1(String
+                                                                                               .valueOf(avr)),
+                                                                                               Formatter.toNumberFormat(min),
+                                                                                               Formatter.toNumberFormat(max));
+                                                       }
+                                                       // File read, write
+                                                       else {
+                                                               insertRangeItem(title,
+                                                                               Formatter.toByteFormat(start),
+                                                                               Formatter.toByteFormat(end),
+                                                                               Formatter.toBpsFormat(sum, startTime,
+                                                                                               endTime),
+                                                                                               Formatter.toByteFormat(min),
+                                                                                               Formatter.toByteFormat(max));
+                                                       }
+                                                       break;
+                                               default:
+                                                       break;
                                                }
-                                               break;
-                                       default:
-                                               break;
                                        }
+                                       avr = count = min = max = sum = 0;
                                }
-                               avr = count = min = max = sum = 0;
                        }
                }
-
+               else{
+               }
                isTimelineSelectedChange = false;
        }