private final Composite contents;
private MemoryChartBoard memoryChartBoard;
private final StackLayout stackLayout;
- private DAChartBoardItem lastSelectedItemForSummary = null;
private Boolean isLatestTraceMode = true;
private final RangeDataManager rangeDataManager = RangeDataManager.getInstance();
memoryChartBoard.addSelectionListener(new DAChartBoardSelectionListener() {
@Override
public void handleSelectionEvent(DAChartBoardItem item) {
- lastSelectedItemForSummary = item;
DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) memoryChartBoard
.getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);
long selectiedStartTime = (long) (intervalMarker.getStartVal() * TimelineConstants.MEGA_DOUBLE);
import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter;\r
import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;\r
import org.tizen.dynamicanalyzer.ui.memory.MemoryPage;\r
+import org.tizen.dynamicanalyzer.ui.memory.data.MemoryDataManager;\r
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;\r
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineChartManager;\r
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;\r
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;\r
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
}\r
\r
public void updateChart() {\r
- TimelineChartManager.getInstance().makeChartSeries(\r
- AnalyzerUtil.translateSecToMicroSec(getVisibleStartTime()),\r
- AnalyzerUtil.translateSecToMicroSec(getVisibleEndTime()));\r
-\r
double timelineMarkerStartTime = RangeDataManager.getInstance().getMarkerStartTime()\r
/ TimelineConstants.MEGA_DOUBLE;\r
double timelineMarkerEndTime = RangeDataManager.getInstance().getMarkerEndTime()\r
long startTime = AnalyzerUtil.translateSecToMicroSec(getVisibleStartTime());\r
long endTime = AnalyzerUtil.translateSecToMicroSec(getVisibleEndTime());\r
\r
- List<List<Object>> systemDBData = TimelineChartManager.getInstance().\r
+ List<List<Object>> systemDBData = MemoryDataManager.getInstance().\r
getSystemDataFromDB(startTime, endTime);\r
int selectedPID = 0;\r
if (Toolbar.INSTANCE != null) {\r
selectedPID = Toolbar.INSTANCE.getSelectedPid();\r
}\r
- Map<Integer, List<List<Object>>> targetProcessDBData = TimelineChartManager.getInstance()\r
- .getTargetProcessDataFromDB(startTime, endTime, selectedPID);\r
+ Map<Integer, List<List<Object>>> targetProcessDBData = MemoryDataManager.getInstance()\r
+ .getTargetProcessDataMapFromDB(startTime, endTime, selectedPID);\r
\r
\r
/*\r
import org.tizen.dynamicanalyzer.resources.ImageResources;\r
import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener;\r
import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter;\r
-import org.tizen.dynamicanalyzer.ui.timeline.TargetProcessDBTable;\r
+import org.tizen.dynamicanalyzer.ui.memory.data.ProcessMemoryDBTable;\r
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;\r
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;\r
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
List<List<Object>> data = processDataMap.get(pid);\r
for (int i = 0; i < data.size(); i++) {\r
List<Object> row = data.get(i);\r
- double time = (Long) row.get(TargetProcessDBTable.COLUMN.SAMPLING_TIME.ordinal())\r
+ double time = (Long) row.get(ProcessMemoryDBTable.COLUMN.SAMPLING_TIME.ordinal())\r
/ TimelineConstants.MEGA_DOUBLE;\r
long vssMemory = (Long) row\r
- .get(TargetProcessDBTable.COLUMN.MEMORY_VIRTUAL.ordinal());\r
+ .get(ProcessMemoryDBTable.COLUMN.MEMORY_VIRTUAL.ordinal());\r
long rssMemory = (Long) row\r
- .get(TargetProcessDBTable.COLUMN.MEMORY_RESIDENT.ordinal());\r
- long pssMemory = (Long) row.get(TargetProcessDBTable.COLUMN.MEMORY_PSS\r
+ .get(ProcessMemoryDBTable.COLUMN.MEMORY_RESIDENT.ordinal());\r
+ long pssMemory = (Long) row.get(ProcessMemoryDBTable.COLUMN.MEMORY_PSS\r
.ordinal());\r
seriesList.get(VSS).addSeriesItem(\r
new DAChartSeriesItem(time, vssMemory, Formatter\r
import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;\r
import org.tizen.dynamicanalyzer.resources.ColorResources;\r
import org.tizen.dynamicanalyzer.resources.ImageResources;\r
-import org.tizen.dynamicanalyzer.ui.timeline.SystemDataDBTable;\r
-import org.tizen.dynamicanalyzer.ui.timeline.TargetProcessDBTable;\r
+import org.tizen.dynamicanalyzer.ui.memory.data.ProcessMemoryDBTable;\r
+import org.tizen.dynamicanalyzer.ui.memory.data.SystemMemoryDBTable;\r
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;\r
import org.tizen.dynamicanalyzer.util.Logger;\r
import org.tizen.dynamicanalyzer.utils.Formatter;\r
double maxTime = 0.0;\r
for (int i = 0; i < systemData.size(); i++) {\r
List<Object> row = systemData.get(i);\r
- double time = (Long) row.get(SystemDataDBTable.COLUMN.SAMPLING_TIME\r
+ double time = (Long) row.get(SystemMemoryDBTable.COLUMN.SAMPLING_TIME\r
.ordinal()) / TimelineConstants.MEGA_DOUBLE;\r
\r
try {\r
long systemMemoryUsage = (Long) row\r
- .get(SystemDataDBTable.COLUMN.MEMORY_USAGE_SYSTEM\r
+ .get(SystemMemoryDBTable.COLUMN.MEMORY_USAGE_SYSTEM\r
.ordinal());\r
totalSeries.addSeriesItem(new DAChartSeriesItem(time,\r
systemMemorySize, Formatter\r
List<List<Object>> data = targetProcessDataMap.get(pid);\r
for (int i = 0; i < data.size(); i++) {\r
List<Object> oneTime = data.get(i);\r
- Long time = (Long) oneTime.get(TargetProcessDBTable.COLUMN.SAMPLING_TIME\r
+ Long time = (Long) oneTime.get(ProcessMemoryDBTable.COLUMN.SAMPLING_TIME\r
.ordinal());\r
Long processMemorySize = (Long) oneTime\r
- .get(TargetProcessDBTable.COLUMN.MEMORY_RESIDENT\r
+ .get(ProcessMemoryDBTable.COLUMN.MEMORY_RESIDENT\r
.ordinal());\r
Long processMemorySizeSum = processLoadSumMap.get(time);\r
if (processMemorySizeSum == null) {\r
import org.tizen.dynamicanalyzer.database.SqlConnectionManager;\r
import org.tizen.dynamicanalyzer.project.BinaryInfo;\r
import org.tizen.dynamicanalyzer.project.LibraryObject;\r
-import org.tizen.dynamicanalyzer.project.ProcessInformation;\r
import org.tizen.dynamicanalyzer.project.ProcessMemoryMap;\r
import org.tizen.dynamicanalyzer.project.Project;\r
import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;\r
import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;\r
import org.tizen.dynamicanalyzer.swap.model.data.LogData;\r
import org.tizen.dynamicanalyzer.swap.model.data.MemoryData;\r
-import org.tizen.dynamicanalyzer.swap.model.data.MemoryMapData;\r
import org.tizen.dynamicanalyzer.swap.model.data.ProcessProfileData;\r
import org.tizen.dynamicanalyzer.swap.model.data.SystemData;\r
+import org.tizen.dynamicanalyzer.ui.timeline.TargetProcessDBTable;\r
import org.tizen.dynamicanalyzer.util.Logger;\r
\r
public class MemoryDataManager extends PageDataManager {\r
\r
return processedResult;\r
}\r
+ \r
+ public Map<Integer, List<List<Object>>> getTargetProcessDataMapFromDB(long start, long end,\r
+ int targetPID) {\r
+ Map<Integer, List<List<Object>>> processedResult = new HashMap<Integer, List<List<Object>>>();\r
+ String where = "WHERE SAMPLING_TIME BETWEEN " + start + " AND " + end;\r
+ if (targetPID > 0) {\r
+ where += " AND PID = " + targetPID;\r
+ } else {\r
+ // Do nothing. Get information from all processes.\r
+ }\r
+ where += " ORDER BY SAMPLING_TIME";\r
+\r
+ List<List<Object>> queryResult = processMemoryDBTable.selectAllColumnData(where);\r
+ if (queryResult == null) {\r
+ return processedResult;\r
+ }\r
+\r
+ for (int i = 0; i < queryResult.size(); i++) {\r
+ List<Object> row = queryResult.get(i);\r
+ Integer pid = (Integer) row.get(TargetProcessDBTable.COLUMN.PID.ordinal());\r
+ List<List<Object>> processData = processedResult.get(pid);\r
+ if (processData == null) {\r
+ processData = new ArrayList<List<Object>>();\r
+ processedResult.put(pid, processData);\r
+ }\r
+ processData.add(row);\r
+ }\r
+ return processedResult;\r
+ }\r
\r
public long getProcessMemoriesFromDB(long time) {\r
long processMemories = 0;\r