Timeline : revision DB of Timeline page 05/28005/1
authorjungwook.ryu <jungwook.ryu@samsung.com>
Wed, 24 Sep 2014 08:33:23 +0000 (17:33 +0900)
committerjungwook.ryu <jungwook.ryu@samsung.com>
Wed, 24 Sep 2014 08:34:48 +0000 (17:34 +0900)
revision query and change column name

Change-Id: I6eaf20d62e8538df668dba9e34de954f66ce8213
Signed-off-by: jungwook.ryu <jungwook.ryu@samsung.com>
19 files changed:
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/screenshot/ScreenShotDBTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/screenshot/ScreenshotDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/screenshot/ScreenshotView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/SystemDataDBTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/TargetProcessDBTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/UIEventDBTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/CPUChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/CPUCoreChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/CPUFrequencyChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/DeviceChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/DiskIOChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/EnergyChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/HeapChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/NetworkIOChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/ProcessMemoryChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/ScreenshotChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/SystemMemoryChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/UIEventChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineChartManager.java

index c9265dd..ba640fd 100644 (file)
@@ -42,12 +42,12 @@ public class ScreenShotDBTable extends DBTable {
        private final static int MAX_IMAGEPATH_LEN = 1024; 
        
        public static enum COLUMN {
-               TIME,
+               CAPTURE_TIME,
                IMAGE_FILE_PATH,
                IMAGE_ORIENTATION
        }
        
-       public static final String TIME = "TIME";
+       public static final String CAPTURE_TIME = "CAPTURE_TIME";
        public static final String IMAGE_FILE_PATH = "IMAGE_FILE_PATH";
        public static final String IMAGE_ORIENTATION = "IMAGE_ORIENTATION";
 
@@ -57,10 +57,10 @@ public class ScreenShotDBTable extends DBTable {
        }
 
        public ScreenShotDBTable() {
-               addColumn(new DBColumn(TIME, DBConstants.NOT_NULL, DBConstants.LONG));
+               addColumn(new DBColumn(CAPTURE_TIME, DBConstants.NOT_NULL, DBConstants.LONG));
                addColumn(new DBColumn(IMAGE_FILE_PATH, DBConstants.NOT_NULL, DBConstants.VARCHAR, MAX_IMAGEPATH_LEN));
                addColumn(new DBColumn(IMAGE_ORIENTATION, DBConstants.NOT_NULL, DBConstants.INTEGER));
-               setIndexColumn(COLUMN.TIME.ordinal());
+               setIndexColumn(COLUMN.CAPTURE_TIME.ordinal());
        }
 
        @Override
@@ -72,7 +72,7 @@ public class ScreenShotDBTable extends DBTable {
                        isPrepared = false;
                } else {
                        try {
-                               prep.setLong(1, (Long) (rowData.get(COLUMN.TIME.ordinal())));
+                               prep.setLong(1, (Long) (rowData.get(COLUMN.CAPTURE_TIME.ordinal())));
                                prep.setString(2, (String) (rowData.get(COLUMN.IMAGE_FILE_PATH.ordinal())));
                                prep.setInt(3, (Integer) (rowData.get(COLUMN.IMAGE_ORIENTATION.ordinal())));
                        } catch (SQLException e) {
index b3e15a7..5d61ea4 100644 (file)
@@ -156,7 +156,7 @@ public class ScreenshotDataManager extends PageDataManager {
                }
 
                String querystr = String.format(SCREENSHOT_QUERY, columnstr.toString(),
-                               screenShotDBTable.getTableName(), ScreenShotDBTable.COLUMN.TIME);
+                               screenShotDBTable.getTableName(), ScreenShotDBTable.COLUMN.CAPTURE_TIME);
 
                ResultSet rs = SqlConnectionManager.executeQueryRS(querystr);
                if (rs != null) {
index 3a01d01..4b8fb73 100644 (file)
@@ -280,16 +280,13 @@ public class ScreenshotView extends DAViewComposite {
        }
 
        private void computeData() {
-               List<Object> row = TimelineChartManager.getInstance().getSystemDataFromDB(startTime);
-               if (row.isEmpty()) {
+               Object[] cpuLoadList = TimelineChartManager.getInstance().getCPULoadFromDB(startTime);
+               if (cpuLoadList == null) {
                        return;
                }
-               @SuppressWarnings("unchecked")
-               List<Object> cpuLoadList = (List<Object>) row.get(SystemDataDBTable.COLUMN.CPU_LOAD
-                               .ordinal());
                cpuUsage.clear();
-               for (int ii = 0; ii < cpuLoadList.size(); ii++) {
-                       double cpu = (Double)cpuLoadList.get(ii);
+               for (int i = 0; i < cpuLoadList.length; i++) {
+                       double cpu = (Double)cpuLoadList[i];
                        long value = (long)cpu;
                        cpuUsage.add(value);
                }
index cda1a81..cf63992 100644 (file)
@@ -40,7 +40,7 @@ public class SystemDataDBTable extends DBTable {
        private static final String TABLENAME = "TIMELINE_SYSTEM_DATA";
 
        public static enum COLUMN {
-               TIME,
+               SAMPLING_TIME,
                CPU_LOAD_TOTAL,
                PROCESS_COUNT_OTHER,
                PROCESS_COUNT_TARGET,
@@ -62,7 +62,7 @@ public class SystemDataDBTable extends DBTable {
                DEVICE_STATUS
        }
 
-       public static final String TIME = "TIME";
+       public static final String SAMPLING_TIME = "SAMPLING_TIME";
        public static final String CPU_LOAD_TOTAL = "CPU_LOAD_TOTAL";
        public static final String PROCESS_COUNT_OTHER = "PROCESS_COUNT_OTHER";
        public static final String PROCESS_COUNT_TARGET = "PROCESS_COUNT_TARGET";
@@ -89,7 +89,7 @@ public class SystemDataDBTable extends DBTable {
        }
 
        public SystemDataDBTable() {
-               addColumn(new DBColumn(TIME, DBConstants.NOT_NULL, DBConstants.LONG));
+               addColumn(new DBColumn(SAMPLING_TIME, DBConstants.NOT_NULL, DBConstants.LONG));
                addColumn(new DBColumn(CPU_LOAD_TOTAL, DBConstants.EMPTY, DBConstants.FLOAT));
                addColumn(new DBColumn(PROCESS_COUNT_OTHER, DBConstants.EMPTY, DBConstants.INTEGER));
                addColumn(new DBColumn(PROCESS_COUNT_TARGET, DBConstants.EMPTY, DBConstants.INTEGER));
@@ -109,7 +109,7 @@ public class SystemDataDBTable extends DBTable {
                addColumn(new DBColumn(PROCESS_PID_OTHER, DBConstants.EMPTY, DBConstants.INTEGER_ARRAY));
                addColumn(new DBColumn(PROCESS_LOAD_OTHER, DBConstants.EMPTY, DBConstants.FLOAT_ARRAY));
                addColumn(new DBColumn(DEVICE_STATUS, DBConstants.EMPTY, DBConstants.INTEGER_ARRAY));
-               setIndexColumn(COLUMN.TIME.ordinal());
+               setIndexColumn(COLUMN.SAMPLING_TIME.ordinal());
        }
 
        @Override
@@ -122,7 +122,7 @@ public class SystemDataDBTable extends DBTable {
                } else {
                        try {
                                int index = 1;
-                               prep.setLong(index++, (Long) (rowData.get(COLUMN.TIME.ordinal())));
+                               prep.setLong(index++, (Long) (rowData.get(COLUMN.SAMPLING_TIME.ordinal())));
                                prep.setFloat(index++, (Float) (rowData.get(COLUMN.CPU_LOAD_TOTAL.ordinal())));
                                prep.setInt(index++, (Integer) (rowData.get(COLUMN.PROCESS_COUNT_OTHER.ordinal())));
                                prep.setInt(index++, (Integer) (rowData.get(COLUMN.PROCESS_COUNT_TARGET.ordinal())));
index 279a8cc..7b1b13b 100644 (file)
@@ -40,7 +40,7 @@ public class TargetProcessDBTable extends DBTable {
        private static final String TABLENAME = "TIMELINE_TARGET_PROCESS";
 
        public static enum COLUMN {
-               TIME,
+               SAMPLING_TIME,
                PID,
                CPU_LOAD,
                MEMORY_VIRTUAL,
@@ -55,7 +55,7 @@ public class TargetProcessDBTable extends DBTable {
                THREAD_LOAD
        }
 
-       public static final String TIME = "TIME";
+       public static final String SAMPLING_TIME = "SAMPLING_TIME";
        public static final String PID = "PID";
        public static final String CPU_LOAD = "CPU_LOAD";
        public static final String MEMORY_VIRTUAL = "MEMORY_VIRTUAL";
@@ -76,7 +76,7 @@ public class TargetProcessDBTable extends DBTable {
        }
 
        public TargetProcessDBTable() {
-               addColumn(new DBColumn(TIME, DBConstants.NOT_NULL, DBConstants.LONG));
+               addColumn(new DBColumn(SAMPLING_TIME, DBConstants.NOT_NULL, DBConstants.LONG));
                addColumn(new DBColumn(PID, DBConstants.EMPTY, DBConstants.INTEGER));
                addColumn(new DBColumn(CPU_LOAD, DBConstants.EMPTY, DBConstants.FLOAT));
                addColumn(new DBColumn(MEMORY_VIRTUAL, DBConstants.EMPTY, DBConstants.LONG));
@@ -90,7 +90,7 @@ public class TargetProcessDBTable extends DBTable {
                addColumn(new DBColumn(HEAP_ALLOCATION_BYTE, DBConstants.EMPTY, DBConstants.BIGINT_ARRAY));
                addColumn(new DBColumn(THREAD_ID, DBConstants.EMPTY, DBConstants.INTEGER_ARRAY));
                addColumn(new DBColumn(THREAD_LOAD, DBConstants.EMPTY, DBConstants.FLOAT_ARRAY));
-               setIndexColumn(COLUMN.TIME.ordinal());
+               setIndexColumn(COLUMN.SAMPLING_TIME.ordinal());
        }
 
        @Override
@@ -103,7 +103,7 @@ public class TargetProcessDBTable extends DBTable {
                } else {
                        try {
                                int index = 0;
-                               prep.setLong(++index, (Long) (rowData.get(COLUMN.TIME.ordinal())));
+                               prep.setLong(++index, (Long) (rowData.get(COLUMN.SAMPLING_TIME.ordinal())));
                                prep.setInt(++index, (Integer) (rowData.get(COLUMN.PID.ordinal())));
                                prep.setFloat(++index, (Float) (rowData.get(COLUMN.CPU_LOAD.ordinal())));
                                prep.setLong(++index, (Long) (rowData.get(COLUMN.MEMORY_VIRTUAL.ordinal())));
index 18526e3..61aec49 100644 (file)
@@ -42,7 +42,7 @@ public class UIEventDBTable extends DBTable {
        private final static int MAX_INFO_LEN = 256; 
        
        public static enum COLUMN {
-               TIME,
+               EVENT_TIME,
                EVENT_TYPE,
                DETAIL_TYPE,
                POINT_X,
@@ -51,7 +51,7 @@ public class UIEventDBTable extends DBTable {
                INFO_INTEGER
        }
        
-       public static final String TIME = "TIME";
+       public static final String EVENT_TIME = "EVENT_TIME";
        public static final String EVENT_TYPE = "EVENT_TYPE";
        public static final String DETAIL_TYPE = "DETAIL_TYPE";
        public static final String POINT_X = "POINT_X";
@@ -65,14 +65,14 @@ public class UIEventDBTable extends DBTable {
        }
 
        public UIEventDBTable() {
-               addColumn(new DBColumn(TIME, DBConstants.NOT_NULL, DBConstants.LONG));
+               addColumn(new DBColumn(EVENT_TIME, DBConstants.NOT_NULL, DBConstants.LONG));
                addColumn(new DBColumn(EVENT_TYPE, DBConstants.NOT_NULL, DBConstants.INTEGER));
                addColumn(new DBColumn(DETAIL_TYPE, DBConstants.NOT_NULL, DBConstants.INTEGER));
                addColumn(new DBColumn(POINT_X, DBConstants.NOT_NULL, DBConstants.INTEGER));
                addColumn(new DBColumn(POINT_Y, DBConstants.NOT_NULL, DBConstants.INTEGER));
                addColumn(new DBColumn(INFO_STRING, DBConstants.NOT_NULL, DBConstants.VARCHAR, MAX_INFO_LEN));
                addColumn(new DBColumn(INFO_INTEGER, DBConstants.NOT_NULL, DBConstants.INTEGER));
-               setIndexColumn(COLUMN.TIME.ordinal());
+               setIndexColumn(COLUMN.EVENT_TIME.ordinal());
        }
 
        @Override
@@ -84,7 +84,7 @@ public class UIEventDBTable extends DBTable {
                        isPrepared = false;
                } else {
                        try {
-                               prep.setLong(1, (Long) (rowData.get(COLUMN.TIME.ordinal())));
+                               prep.setLong(1, (Long) (rowData.get(COLUMN.EVENT_TIME.ordinal())));
                                prep.setInt(2, (Integer) (rowData.get(COLUMN.EVENT_TYPE.ordinal())));
                                prep.setInt(3, (Integer) (rowData.get(COLUMN.DETAIL_TYPE.ordinal())));
                                prep.setInt(4, (Integer) (rowData.get(COLUMN.POINT_X.ordinal())));
index 5fd4030..2c5ce20 100644 (file)
@@ -180,7 +180,7 @@ public class CPUChart extends TimelineChart {
                 */
                for (int i = 0; i < systemData.size(); i++) {
                        List<Object> row = systemData.get(i);
-                       double time = (Long) row.get(SystemDataDBTable.COLUMN.TIME.ordinal())
+                       double time = (Long) row.get(SystemDataDBTable.COLUMN.SAMPLING_TIME.ordinal())
                                        / TimelineConstants.MEGA_DOUBLE;
 
                        try {
@@ -231,7 +231,7 @@ public class CPUChart extends TimelineChart {
                        List<List<Object>> data = targetProcessDataMap.get(pid);
                        for (int i = 0; i < data.size(); i++) {
                                List<Object> oneTime = data.get(i);
-                               Long time = (Long) oneTime.get(TargetProcessDBTable.COLUMN.TIME.ordinal());
+                               Long time = (Long) oneTime.get(TargetProcessDBTable.COLUMN.SAMPLING_TIME.ordinal());
                                Float cpuLoad = (Float) oneTime.get(TargetProcessDBTable.COLUMN.CPU_LOAD.ordinal());
                                Float processLoadSum = processLoadSumMap.get(time);
                                if (processLoadSum == null) {
index 91eeb83..8fda361 100644 (file)
@@ -109,7 +109,7 @@ public class CPUCoreChart extends TimelineChart {
                                .get(TimelineConstants.SYSTEM_DB_DATA);
                for (int i = 0; i < data.size(); i++) {
                        List<Object> row = data.get(i);
-                       double time = (Long) row.get(SystemDataDBTable.COLUMN.TIME.ordinal())
+                       double time = (Long) row.get(SystemDataDBTable.COLUMN.SAMPLING_TIME.ordinal())
                                        / TimelineConstants.MEGA_DOUBLE;
                        @SuppressWarnings("unchecked")
                        List<Object> cpuLoadList = (List<Object>) row.get(SystemDataDBTable.COLUMN.CPU_LOAD
index 8a0b0cf..b9bd85d 100644 (file)
@@ -105,7 +105,7 @@ public class CPUFrequencyChart extends TimelineChart {
                                .get(TimelineConstants.SYSTEM_DB_DATA);
                for (int i = 0; i < data.size(); i++) {
                        List<Object> row = data.get(i);
-                       double time = (Long) row.get(SystemDataDBTable.COLUMN.TIME.ordinal())
+                       double time = (Long) row.get(SystemDataDBTable.COLUMN.SAMPLING_TIME.ordinal())
                                        / TimelineConstants.MEGA_DOUBLE;
                        @SuppressWarnings("unchecked")
                        List<Object> cpuLoadList = (List<Object>) row.get(SystemDataDBTable.COLUMN.CPU_FREQUENCY
index c1d3921..21e19a1 100644 (file)
@@ -134,7 +134,7 @@ public class DeviceChart extends TimelineChart {
 
                for (int i = 0; i < data.size(); i++) {
                        List<Object> row = data.get(i);
-                       double time = (Long) row.get(SystemDataDBTable.COLUMN.TIME.ordinal())
+                       double time = (Long) row.get(SystemDataDBTable.COLUMN.SAMPLING_TIME.ordinal())
                                        / TimelineConstants.MEGA_DOUBLE;
 
                        @SuppressWarnings("unchecked")
index 96ec2b8..88e2719 100644 (file)
@@ -127,7 +127,7 @@ public class DiskIOChart extends TimelineChart {
                
                for (int i = 0; i < data.size(); i++) {
                        List<Object> row = data.get(i);
-                       double time = (Long)row.get(SystemDataDBTable.COLUMN.TIME.ordinal())
+                       double time = (Long)row.get(SystemDataDBTable.COLUMN.SAMPLING_TIME.ordinal())
                                / TimelineConstants.MEGA_DOUBLE;
                        long readCount = (Long)row.get(SystemDataDBTable.COLUMN.DISK_IO_READ_OP_COUNT.ordinal());
                        long writeCount = (Long)row.get(SystemDataDBTable.COLUMN.DISK_IO_WRITE_OP_COUNT.ordinal());
index 6eafc16..1330e6d 100644 (file)
@@ -161,7 +161,7 @@ public class EnergyChart extends TimelineChart {
 
                        for (int i = 0; i < systemData.size(); i++) {
                                List<Object> row = systemData.get(i);
-                               double time = (Long) row.get(SystemDataDBTable.COLUMN.TIME.ordinal())
+                               double time = (Long) row.get(SystemDataDBTable.COLUMN.SAMPLING_TIME.ordinal())
                                                / TimelineConstants.MEGA_DOUBLE;
                                try {
                                        long energyUsage = (Long) row.get(SystemDataDBTable.COLUMN.ENERGY_USAGE
index 638e26d..fb72833 100644 (file)
@@ -230,7 +230,7 @@ public class HeapChart extends TimelineChart {
                        Map<String, DAChartSeries> seriesMap = seriesPerProcessMap.get(pid);
                        for (int i = 0; i < data.size(); i++) {
                                List<Object> row = data.get(i);
-                               double time = (Long) row.get(TargetProcessDBTable.COLUMN.TIME.ordinal())
+                               double time = (Long) row.get(TargetProcessDBTable.COLUMN.SAMPLING_TIME.ordinal())
                                                / TimelineConstants.MEGA_DOUBLE;
                                long totalAlloc = (Long) row
                                                .get(TargetProcessDBTable.COLUMN.HEAP_ALLOCATION_TOTAL_BYTE.ordinal());
index f4a89f0..07493c3 100644 (file)
@@ -101,7 +101,7 @@ public class NetworkIOChart extends TimelineChart {
                
                for (int i = 0; i < data.size(); i++) {
                        List<Object> row = data.get(i);
-                       double time = (Long)row.get(SystemDataDBTable.COLUMN.TIME.ordinal())
+                       double time = (Long)row.get(SystemDataDBTable.COLUMN.SAMPLING_TIME.ordinal())
                                / TimelineConstants.MEGA_DOUBLE;
                        long sendSize = (Long)row.get(SystemDataDBTable.COLUMN.NETWORK_SIZE_SEND.ordinal());
                        long receiveSize = (Long)row.get(SystemDataDBTable.COLUMN.NETWORK_SIZE_RECEIVE.ordinal());
index 24d906a..169dda1 100644 (file)
@@ -210,7 +210,7 @@ public class ProcessMemoryChart extends TimelineChart {
                        List<List<Object>> data = processDataMap.get(pid);
                        for (int i = 0; i < data.size(); i++) {
                                List<Object> row = data.get(i);
-                               double time = (Long) row.get(TargetProcessDBTable.COLUMN.TIME.ordinal())
+                               double time = (Long) row.get(TargetProcessDBTable.COLUMN.SAMPLING_TIME.ordinal())
                                                / TimelineConstants.MEGA_DOUBLE;
                                long vssMemory = (Long) row
                                                .get(TargetProcessDBTable.COLUMN.MEMORY_VIRTUAL.ordinal());
index 040fe60..06440a2 100644 (file)
@@ -98,7 +98,7 @@ public class ScreenshotChart extends TimelineChart {
                try {
                    for (int i = 0; i < data.size(); i++) {
                        List<Object> row = data.get(i);
-                       double time = (Long)row.get(ScreenShotDBTable.COLUMN.TIME.ordinal())
+                       double time = (Long)row.get(ScreenShotDBTable.COLUMN.CAPTURE_TIME.ordinal())
                                / TimelineConstants.MEGA_DOUBLE;
                        String fileName = (String)row.get(ScreenShotDBTable.COLUMN.IMAGE_FILE_PATH.ordinal());
                        int orientation = (Integer)row.get(ScreenShotDBTable.COLUMN.IMAGE_ORIENTATION.ordinal());
index b66bfde..de0f63b 100644 (file)
@@ -127,7 +127,7 @@ public class SystemMemoryChart extends TimelineChart {
                double maxTime = 0.0;
                for (int i = 0; i < systemData.size(); i++) {
                        List<Object> row = systemData.get(i);
-                       double time = (Long) row.get(SystemDataDBTable.COLUMN.TIME
+                       double time = (Long) row.get(SystemDataDBTable.COLUMN.SAMPLING_TIME
                                        .ordinal()) / TimelineConstants.MEGA_DOUBLE;
 
                        try {
@@ -156,7 +156,7 @@ public class SystemMemoryChart extends TimelineChart {
                        List<List<Object>> data = targetProcessDataMap.get(pid);
                        for (int i = 0; i < data.size(); i++) {
                                List<Object> oneTime = data.get(i);
-                               Long time = (Long) oneTime.get(TargetProcessDBTable.COLUMN.TIME
+                               Long time = (Long) oneTime.get(TargetProcessDBTable.COLUMN.SAMPLING_TIME
                                                .ordinal());
                                Long processMemorySize = (Long) oneTime
                                                .get(TargetProcessDBTable.COLUMN.MEMORY_RESIDENT
index 0a2f243..12923cb 100644 (file)
@@ -149,7 +149,7 @@ public class UIEventChart extends TimelineChart {
                
                for (int i = 0; i < data.size(); i++) {
                        List<Object> row = data.get(i);
-                       double time = (Long)row.get(UIEventDBTable.COLUMN.TIME.ordinal())
+                       double time = (Long)row.get(UIEventDBTable.COLUMN.EVENT_TIME.ordinal())
                                / TimelineConstants.MEGA_DOUBLE;
                        int eventType = (Integer)row.get(UIEventDBTable.COLUMN.EVENT_TYPE.ordinal());
                        int detailType = (Integer)row.get(UIEventDBTable.COLUMN.DETAIL_TYPE.ordinal());
index a211331..969ba6b 100644 (file)
@@ -682,8 +682,8 @@ public class TimelineChartManager extends PageDataManager implements IDAChartSer
        }
 
        public List<List<Object>> getSystemDataFromDB(long start, long end) {
-               String where = "where TIME BETWEEN " + start + " AND " + end + " ORDER BY "
-                               + SystemDataDBTable.TIME;
+               String where = "WHERE " + SystemDataDBTable.SAMPLING_TIME + " BETWEEN " + start + " AND " + end +
+                               " ORDER BY " + SystemDataDBTable.SAMPLING_TIME;
                List<List<Object>> result = systemDataTable.selectAllColumnData(where);
 
                if (result != null) {
@@ -693,27 +693,31 @@ public class TimelineChartManager extends PageDataManager implements IDAChartSer
                }
        }
 
-       public List<Object> getSystemDataFromDB(long time) {
-               String where = "where TIME = (SELECT MAX(TIME) FROM TIMELINE_SYSTEM_DATA WHERE TIME <= "
-                               + time + ")";
-               List<List<Object>> result = systemDataTable.selectAllColumnData(where);
-
-               if (result == null || result.isEmpty()) {
-                       where = "where TIME = (SELECT MIN(time) FROM TIMELINE_SYSTEM_DATA)";
-                       result = systemDataTable.selectAllColumnData(where);
-                       if (result == null || result.isEmpty()) {
-                               return new ArrayList<Object>();
-                       } else {
-                               return result.get(0);
+       public Object[] getCPULoadFromDB(long time) {
+               Object[] cpuLoadList = null;
+               String query = "SELECT " + SystemDataDBTable.CPU_LOAD + " FROM "
+                               + systemDataTable.getTableName() + " WHERE " + SystemDataDBTable.SAMPLING_TIME +
+                               " = (SELECT MAX(TIME) FROM " + systemDataTable.getTableName() + " WHERE " +
+                               SystemDataDBTable.SAMPLING_TIME + " <= " + time + ")";
+               ResultSet rs = SqlConnectionManager.executeQueryRS(query);
+               if (rs != null) {
+                       try {
+                               while (rs.next()) {
+                                       cpuLoadList = (Object[])rs.getArray(SystemDataDBTable.CPU_LOAD).getArray();
+                               }
+                       } catch (SQLException e) {
+                               e.printStackTrace();
+                       } finally {
+                               SqlConnectionManager.releaseResultSet(rs);
                        }
-               } else {
-                       return result.get(0);
                }
+               
+               return cpuLoadList;
        }
 
        public List<List<Object>> getUIEventDataFromDB(long start, long end) {
-               String where = "where TIME BETWEEN " + start + " AND " + end + " ORDER BY "
-                               + UIEventDBTable.TIME;
+               String where = "WHERE " + UIEventDBTable.EVENT_TIME + " BETWEEN " + start + " AND " +
+                               end + " ORDER BY " + UIEventDBTable.EVENT_TIME;
                List<List<Object>> result = uiEventDBTable.selectAllColumnData(where);
 
                if (result != null) {
@@ -724,8 +728,8 @@ public class TimelineChartManager extends PageDataManager implements IDAChartSer
        }
 
        public List<List<Object>> getScreenShotDataFromDB(long start, long end) {
-               String where = "where TIME BETWEEN " + start + " AND " + end + " ORDER BY "
-                               + ScreenShotDBTable.TIME;
+               String where = "WHERE " + ScreenShotDBTable.CAPTURE_TIME + " BETWEEN " + start + " AND " +
+                               end + " ORDER BY " + ScreenShotDBTable.CAPTURE_TIME;
                List<List<Object>> result = ScreenshotDataManager.getInstance().getScreenShotTable()
                                .selectAllColumnData(where);
 
@@ -751,8 +755,8 @@ public class TimelineChartManager extends PageDataManager implements IDAChartSer
        public Map<Integer, List<List<Object>>> getTargetProcessDataFromDB(long start, long end) {
                Map<Integer, List<List<Object>>> processedResult = new HashMap<Integer, List<List<Object>>>();
 
-               String where = "where TIME BETWEEN " + start + " AND " + end + " ORDER BY "
-                               + TargetProcessDBTable.TIME;
+               String where = "WHERE " + TargetProcessDBTable.SAMPLING_TIME + " BETWEEN " + start + " AND " + end +
+                               " ORDER BY " + TargetProcessDBTable.SAMPLING_TIME;
                List<List<Object>> queryResult = targetProcessDBTable.selectAllColumnData(where);
                if (queryResult == null) {
                        return processedResult;
@@ -774,8 +778,9 @@ public class TimelineChartManager extends PageDataManager implements IDAChartSer
        public long getProcessMemoriesFromDB(long time) {
                long processMemories = 0;
                String query = "SELECT " + TargetProcessDBTable.MEMORY_RESIDENT + " FROM "
-                               + targetProcessDBTable.getTableName() + " WHERE TIME = (SELECT MAX(TIME) FROM "
-                               + targetProcessDBTable.getTableName() + " WHERE TIME <= " + time + ")";
+                               + targetProcessDBTable.getTableName() + " WHERE " + TargetProcessDBTable.SAMPLING_TIME +
+                               " = (SELECT MAX(TIME) FROM " + targetProcessDBTable.getTableName() + " WHERE " + 
+                               TargetProcessDBTable.SAMPLING_TIME + " <= " + time + ")";
                ResultSet rs = SqlConnectionManager.executeQueryRS(query);
                if (rs != null) {
                        try {