From f1a8f45aeaa2b4692c2aee6964c28624a7372771 Mon Sep 17 00:00:00 2001 From: Jaewon Lim Date: Thu, 3 May 2012 11:12:17 +0900 Subject: [PATCH] [Title] delete unused file by version upgrade [Type] bug fix [Module] dynamic analyzer [Priority] minor [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- .../constants/SeriesNameConstants.java | 23 --- .../tizen/dynamicanalyzer/model/ApiCountInfo.java | 34 ---- .../timeline/chart/AllocationChart.java | 177 --------------------- .../views/filePage/fileChart/FileFailedData.java | 29 ---- .../summaryPage/UserFunctionProfilingView.java | 60 ------- .../utils/ApiCountInfoSortComparator.java | 26 --- 6 files changed, 349 deletions(-) delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/constants/SeriesNameConstants.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/ApiCountInfo.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/AllocationChart.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/filePage/fileChart/FileFailedData.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/summaryPage/UserFunctionProfilingView.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/ApiCountInfoSortComparator.java diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/constants/SeriesNameConstants.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/constants/SeriesNameConstants.java deleted file mode 100644 index da24aa2..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/constants/SeriesNameConstants.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.tizen.dynamicanalyzer.constants; - -public class SeriesNameConstants { - public static String SERIES_NAME_ALLOCATION = "Allocation"; //$NON-NLS-1$ - public static String SERIES_NAME_CPU_APP = "App load"; //$NON-NLS-1$ - public static String SERIES_NAME_CPU_SYSTEM = "System load"; //$NON-NLS-1$ - public static String SERIES_NAME_PROCESS_MEMORY = "Process"; //$NON-NLS-1$ - public static String SERIES_NAME_AVAILABLE_MEMORY = "Available"; //$NON-NLS-1$ - public static String SERIES_NAME_MOUSE_DOWN = "Down"; //$NON-NLS-1$ - public static String SERIES_NAME_MOUSE_MOVE = "Move"; //$NON-NLS-1$ - public static String SERIES_NAME_MOUSE_UP = "Up"; //$NON-NLS-1$ - public static String SERIES_NAME_WIFI_ENABLE = "Unconnected"; //$NON-NLS-1$ - public static String SERIES_NAME_WIFI_CONNECTED = "Connected"; //$NON-NLS-1$ - public static String SERIES_NAME_WIFI_TRANSFER = "Transfer"; //$NON-NLS-1$ - public static String SERIES_NAME_BT_VISIBLE = "Visible"; //$NON-NLS-1$ - public static String SERIES_NAME_BT_TRANSFER = "Transfer"; //$NON-NLS-1$ - public static String SERIES_NAME_GPS_SEARCHING = "Searching"; //$NON-NLS-1$ - public static String SERIES_NAME_GPS_CONNECTED = "Connected"; //$NON-NLS-1$ - public static String SERIES_NAME_ENERGY = "Energy"; //$NON-NLS-1$ - public static String SERIES_NAME_READ = "Read"; //$NON-NLS-1$ - public static String SERIES_NAME_WRITE = "Write"; //$NON-NLS-1$ - public static String SERIES_NAME_FDCOUNT = "FD Count"; //$NON-NLS-1$ -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/ApiCountInfo.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/ApiCountInfo.java deleted file mode 100644 index ca5b731..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/ApiCountInfo.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.tizen.dynamicanalyzer.model; - -public class ApiCountInfo { - private String name; - private int count; - - public ApiCountInfo(String name) - { - this.name = name; - count = 1; - } - - public ApiCountInfo(String name, int count) - { - this.name = name; - this.count = count; - } - - public String getName() - { - return name; - } - - public int getCount() - { - return count; - } - - public void increaseCount() - { - count++; - } - -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/AllocationChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/AllocationChart.java deleted file mode 100644 index 6bdbc0e..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/AllocationChart.java +++ /dev/null @@ -1,177 +0,0 @@ -package org.tizen.dynamicanalyzer.timeline.chart; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.swt.widgets.Display; -import org.jfree.chart.ChartFactory; -import org.jfree.chart.JFreeChart; -import org.jfree.chart.axis.NumberAxis; -import org.jfree.chart.plot.PlotOrientation; -import org.jfree.chart.plot.XYPlot; -import org.jfree.chart.renderer.xy.XYAreaRenderer; -import org.jfree.data.time.FixedMillisecond; -import org.jfree.data.time.TimeSeries; -import org.jfree.data.time.TimeSeriesCollection; -import org.tizen.dynamicanalyzer.constants.LogCenterConstants; -import org.tizen.dynamicanalyzer.constants.TimelineConstants; -import org.tizen.dynamicanalyzer.timeline.TempConstants; -import org.tizen.dynamicanalyzer.utils.TimelineUtils; - - -public class AllocationChart extends TimelineChart { - public static final String CHART_TITLE = "Allocation"; - public static final String SERIES_NAME_ALLOCATION = "Allocation"; - public static final Color COLOR_ALLOCATION = TempConstants.LINE_COLOR_GOLDENROD; - - class AllocationSeriesInfo { - TimeSeries baseSeries; - TimeSeries newSeries; - } - - private AllocationSeriesInfo allocationInfo; - - public AllocationChart() { - allocationInfo = new AllocationSeriesInfo(); - allocationInfo.baseSeries = new TimeSeries(SERIES_NAME_ALLOCATION); - allocationInfo.newSeries = new TimeSeries(SERIES_NAME_ALLOCATION); - allocationInfo.newSeries.addOrUpdate(TimelineUtils.convertToFixedMs(0), 0); - } - - @Override - public JFreeChart createChart() { - /* Data */ - TimeSeriesCollection dataset = createRWDataset(); - - /* Create */ - chart = ChartFactory.createXYAreaChart(CHART_TITLE, "Time", "Size", dataset, PlotOrientation.VERTICAL, true, false, false); - - if (null == chart) { - return null; - } - - XYPlot xyplot = (XYPlot) chart.getPlot(); - xyplot.setForegroundAlpha(1.0f); - setChartStyle(); - setSeriesRendering(xyplot); - setTimeDomainScopeStart(0); - - return chart; - } - - private TimeSeriesCollection createRWDataset() { - TimeSeriesCollection timeDataSet = new TimeSeriesCollection(allocationInfo.baseSeries); - - return timeDataSet; - } - - @Override - public void update() { - if (null == allocationInfo.baseSeries) { - return; - } else if (allocationInfo.baseSeries.isEmpty()) { - TimeSeries baseSeries = ChartDataSetCenter.getBaseSeries(TimelineConstants.CHART_TYPE_ALLOCATION, SERIES_NAME_ALLOCATION); - if (null != baseSeries) { - allocationInfo.newSeries.addAndOrUpdate(baseSeries); - } - } - - TimeSeries newSeries = ChartDataSetCenter.getNewSeries(TimelineConstants.CHART_TYPE_ALLOCATION, SERIES_NAME_ALLOCATION); - if (null != newSeries) { - allocationInfo.newSeries.addAndOrUpdate(newSeries); - ChartDataSetCenter.clearNewSeries(TimelineConstants.CHART_TYPE_ALLOCATION, SERIES_NAME_ALLOCATION); - } - - Display.getDefault().asyncExec(new Runnable() { - @Override - public void run() { - allocationInfo.baseSeries.addAndOrUpdate(allocationInfo.newSeries); - allocationInfo.newSeries.clear(); - } - }); - } - - @Override - public void clear() { - if(null == chart) { - return; - } - - allocationInfo.newSeries.clear(); - - Display.getDefault().asyncExec(new Runnable() { - @Override - public void run() { - allocationInfo.baseSeries.clear(); - } - }); - } - - @Override - public void dispose() { - } - - public static void parsingLogList(List> logList) { - if (null == logList || 0 == logList.size()) { - return; - } - - for (int i = 0; i < logList.size(); i++) { - parsingLog(logList.get(i)); - } - } - - private static void parsingLog(List log) { - if (null == log || 0 > log.size()) { - return; - } - - - if(!log.get(LogCenterConstants.DEVICE_ALLOCATED_MEMORY_INDEX).isEmpty()) { - long time = 0; - double value = 0; - - try{ - time = Long.parseLong(log.get(LogCenterConstants.DEVICE_TIME_INDEX)) / TimelineConstants.TIME_US_TO_MS; - value = Double.parseDouble(log.get(LogCenterConstants.DEVICE_ALLOCATED_MEMORY_INDEX))/ TimelineConstants.BYTE_TO_KBYTE; - } catch (NumberFormatException ne) { - ne.printStackTrace(); - } catch (NullPointerException ne) { - ne.printStackTrace(); - } catch (Exception e) { - e.printStackTrace(); - } - - SeriesDataSet newDataSet = ChartDataSetCenter.getSeriesDataSet(TimelineConstants.CHART_TYPE_ALLOCATION, SERIES_NAME_ALLOCATION); - - FixedMillisecond fmSec = TimelineUtils.convertToFixedMs(time); - newDataSet.getNewSeries().addOrUpdate(fmSec, value); - - ChartDataSetCenter.setNewSeriesDataSet(TimelineConstants.CHART_TYPE_ALLOCATION, SERIES_NAME_ALLOCATION, newDataSet); - } - } - - public static List newSeriesDataSetList() { - List seriesDataSetList = new ArrayList(); - - SeriesDataSet allocDataSet = new SeriesDataSet(); - allocDataSet.setSeriesName(SERIES_NAME_ALLOCATION); - allocDataSet.setBaseSeries(new TimeSeries(SERIES_NAME_ALLOCATION)); - allocDataSet.setNewSeries(new TimeSeries(SERIES_NAME_ALLOCATION)); - seriesDataSetList.add(allocDataSet); - - return seriesDataSetList; - } - - private void setSeriesRendering(XYPlot xyplot) { - if (null == xyplot) { - return; - } - - XYAreaRenderer renderer = (XYAreaRenderer) xyplot.getRenderer(); - renderer.setSeriesPaint(0, COLOR_ALLOCATION); - xyplot.getRangeAxis().setStandardTickUnits(NumberAxis.createIntegerTickUnits()); - xyplot.setRenderer(renderer); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/filePage/fileChart/FileFailedData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/filePage/fileChart/FileFailedData.java deleted file mode 100644 index 92d7093..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/filePage/fileChart/FileFailedData.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.tizen.dynamicanalyzer.ui.views.filePage.fileChart; - -import java.util.List; - -import org.tizen.dynamicanalyzer.constants.LogCenterConstants; -import org.tizen.dynamicanalyzer.model.FailedData; - - -public class FileFailedData extends FailedData { - - public FileFailedData(List input) { - super(input); - // TODO Auto-generated constructor stub - } - - private String fileKey = null; - - public String getFileKey() { - return fileKey; - } - - public void setFileKey(String key) { - fileKey = key; - } - - public String getTime() { - return getData().get(LogCenterConstants.TIME_INDEX); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/summaryPage/UserFunctionProfilingView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/summaryPage/UserFunctionProfilingView.java deleted file mode 100644 index 8c0deeb..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/summaryPage/UserFunctionProfilingView.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.tizen.dynamicanalyzer.ui.views.summaryPage; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.tizen.dynamicanalyzer.ColorResources; -import org.tizen.dynamicanalyzer.model.DAView; -import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer; -import org.tizen.dynamicanalyzer.ui.widgets.DATable.DATableComposite; -import org.tizen.dynamicanalyzer.ui.widgets.tables.ProfilingTable; - - -public class UserFunctionProfilingView extends DAView { - - public static final String ID = UserFunctionProfilingView.class.getName(); - private DATableComposite treeComp = null; - private String[] columnNames = {"", "Name", "excl. cpu time", "excl. cpu rate", "incl. cpu time", "incl. cpu rate", "call count"}; - private int[] columnSizes = { 40, 150, 70, 50, 70, 50, 50 }; - private boolean[] columnVisibility = {true, true, true, true, true, true, true }; - - public UserFunctionProfilingView(Composite parent, int style) { - super(parent, style); - this.setLayout(new FillLayout()); - - ViewContainer viewContainer = new ViewContainer(this, true); - viewContainer.setTitleText("User function profiling"); - - Composite contents = viewContainer.getContentArea(); - contents.setBackground(ColorResources.WINDOW_BG_COLOR); - contents.setLayout(new FillLayout()); - treeComp = new ProfilingTable(contents, SWT.NONE, SWT.MULTI - | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); - /*** setTree set first!!! ***/ - treeComp.setTree(true); - treeComp.setColumns(columnNames); - treeComp.setColumnSize(columnSizes); - treeComp.setColumnVisibility(columnVisibility); - } - - @Override - public void updateView() { - treeComp.updateTable(); - } - - @Override - public void clear() { - treeComp.clear(); - } - - @Override - public Control getControl() { - return treeComp; - } - - @Override - public void otherViewSelectionCccured() { - treeComp.deselectAll(); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/ApiCountInfoSortComparator.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/ApiCountInfoSortComparator.java deleted file mode 100644 index 89db7a9..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/ApiCountInfoSortComparator.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.tizen.dynamicanalyzer.utils; - -import java.util.Comparator; - -import org.tizen.dynamicanalyzer.model.ApiCountInfo; - - -public class ApiCountInfoSortComparator implements Comparator { - - @Override - public int compare(ApiCountInfo one, ApiCountInfo two) { - int ret = 0; - - if (one.getCount() > two.getCount()) - { - return -1; - } - else if (one.getCount() < two.getCount()) - { - return 1; - } - - return ret; - } - -} -- 2.7.4