Timeline : values of Disk IO chart are changed. 75/24375/1
authorjungwook.ryu <jungwook.ryu@samsung.com>
Fri, 11 Jul 2014 08:55:24 +0000 (17:55 +0900)
committerjungwook.ryu <jungwook.ryu@samsung.com>
Fri, 11 Jul 2014 08:57:20 +0000 (17:57 +0900)
Disk IO Chart will be show write/read operation count & byte size.

Change-Id: Icb72aee260c7233c7de59f02f9edfd5865603125
Signed-off-by: jungwook.ryu <jungwook.ryu@samsung.com>
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/swap/model/data/SystemData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/SystemDataDBTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/DiskIOChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineChartManager.java

index 3a0fea6..713ce26 100644 (file)
@@ -78,10 +78,10 @@ public class TimelineChartLabels extends NLS {
        
        public static String DISK_IO_CHART_TITLE;
        public static String DISK_IO_CHART_DESCRIPTOR;
-       public static String DISK_IO_CHART_SERIES_READ;
-       public static String DISK_IO_CHART_SERIES_WRITE;
-       public static String DISK_IO_CHART_SERIES_READ_SECTOR;
-       public static String DISK_IO_CHART_SERIES_WRITE_SECTOR;
+       public static String DISK_IO_CHART_SERIES_READ_OP_COUNT;
+       public static String DISK_IO_CHART_SERIES_WRITE_OP_COUNT;
+       public static String DISK_IO_CHART_SERIES_READ_BYTE_SIZE;
+       public static String DISK_IO_CHART_SERIES_WRITE_BYTE_SIZE;
        
        public static String NETWORK_IO_CHART_TITLE;
        public static String NETWORK_IO_CHART_DESCRIPTOR;
index dd5c869..8e3cd29 100644 (file)
@@ -53,10 +53,10 @@ UI_EVENT_CHART_DESCRIPTOR=Shows UI events that occur on the device.
 
 DISK_IO_CHART_TITLE=Disk IO
 DISK_IO_CHART_DESCRIPTOR=Shows disk read/write bytes and number of sectors.
-DISK_IO_CHART_SERIES_READ=Read Byte
-DISK_IO_CHART_SERIES_WRITE=Write Byte
-DISK_IO_CHART_SERIES_READ_SECTOR=Sector read count
-DISK_IO_CHART_SERIES_WRITE_SECTOR=Sector write count
+DISK_IO_CHART_SERIES_READ_OP_COUNT=Disk Read Operations
+DISK_IO_CHART_SERIES_WRITE_OP_COUNT=Disk Write Operations
+DISK_IO_CHART_SERIES_READ_BYTE_SIZE=Disk Bytes Read
+DISK_IO_CHART_SERIES_WRITE_BYTE_SIZE=Disk Bytes Written
        
 NETWORK_IO_CHART_TITLE=Network IO
 NETWORK_IO_CHART_DESCRIPTOR=Shows network send/receive bytes.
index a8024b0..a318575 100644 (file)
@@ -48,10 +48,10 @@ public class SystemData extends LogData {
        int otherProcessCount = 0;
        String otherProcessLoad = null;
        int totalUsedDrive = 0;
-       int diskReadSize = 0;
-       int diskReadSectorCount = 0;
-       int diskWriteSize = 0;
-       int diskWrittenSectorCount = 0;
+       int diskReadOpCount = 0;
+       int diskReadByteSize = 0;
+       int diskWriteOpCount = 0;
+       int diskWrittenByteSize = 0;
        int networkSendSize = 0;
        int networkReceiveSize = 0;
        int wifi = 0;
@@ -114,16 +114,16 @@ public class SystemData extends LogData {
                totalUsedDrive = ByteUtil.toInt(data, index);
                index += INT_SIZE;
 
-               diskReadSize = ByteUtil.toInt(data, index);
+               diskReadOpCount = ByteUtil.toInt(data, index);
                index += INT_SIZE;
 
-               diskReadSectorCount = ByteUtil.toInt(data, index);
+               diskReadByteSize = ByteUtil.toInt(data, index);
                index += INT_SIZE;
 
-               diskWriteSize = ByteUtil.toInt(data, index);
+               diskWriteOpCount = ByteUtil.toInt(data, index);
                index += INT_SIZE;
 
-               diskWrittenSectorCount = ByteUtil.toInt(data, index);
+               diskWrittenByteSize = ByteUtil.toInt(data, index);
                index += INT_SIZE;
 
                networkSendSize = ByteUtil.toInt(data, index);
@@ -424,36 +424,36 @@ public class SystemData extends LogData {
                this.systemMemoryUsed = systemMemoryUsed;
        }
 
-       public int getDiskReadSize() {
-               return diskReadSize;
+       public int getDiskReadOpCount() {
+               return diskReadOpCount;
        }
 
-       public void setDiskReadSize(int diskReadSize) {
-               this.diskReadSize = diskReadSize;
+       public void setDiskReadOpCount(int diskReadOpCount) {
+               this.diskReadOpCount = diskReadOpCount;
        }
 
-       public int getDiskReadSectorCount() {
-               return diskReadSectorCount;
+       public int getDiskReadByteSize() {
+               return diskReadByteSize;
        }
 
-       public void setDiskReadSectorCount(int diskReadSectorCount) {
-               this.diskReadSectorCount = diskReadSectorCount;
+       public void setDiskReadByteSize(int diskReadByteSize) {
+               this.diskReadByteSize = diskReadByteSize;
        }
 
-       public int getDiskWriteSize() {
-               return diskWriteSize;
+       public int getDiskWriteOpCount() {
+               return diskWriteOpCount;
        }
 
-       public void setDiskWriteSize(int diskWriteSize) {
-               this.diskWriteSize = diskWriteSize;
+       public void setDiskWriteSize(int diskWriteOpCount) {
+               this.diskWriteOpCount = diskWriteOpCount;
        }
 
-       public int getDiskWrittenSectorCount() {
-               return diskWrittenSectorCount;
+       public int getDiskWrittenByteSize() {
+               return diskWrittenByteSize;
        }
 
-       public void setDiskWrittenSectorCount(int diskWrittenSectorCount) {
-               this.diskWrittenSectorCount = diskWrittenSectorCount;
+       public void setDiskWrittenByteSize(int diskWrittenByteSize) {
+               this.diskWrittenByteSize = diskWrittenByteSize;
        }
 
        public int getEnergyUsage() {
@@ -537,10 +537,10 @@ public class SystemData extends LogData {
                prep.setLong(index++, 0);
                prep.setLong(index++, systemMemoryUsed);
                prep.setInt(index++, totalUsedDrive);
-               prep.setInt(index++, diskReadSize);
-               prep.setInt(index++, diskReadSectorCount);
-               prep.setInt(index++, diskWriteSize);
-               prep.setInt(index++, diskWrittenSectorCount);
+               prep.setInt(index++, diskReadOpCount);
+               prep.setInt(index++, diskReadByteSize);
+               prep.setInt(index++, diskWriteOpCount);
+               prep.setInt(index++, diskWrittenByteSize);
                prep.setInt(index++, networkSendSize);
                prep.setInt(index++, networkReceiveSize);
                prep.setInt(index++, wifi);
@@ -573,9 +573,9 @@ public class SystemData extends LogData {
                cpuLoad = rs.getString(index++);
                systemMemoryUsed = rs.getLong(index++);
                totalUsedDrive = rs.getInt(index++);
-               diskReadSize = rs.getInt(index++);
-               diskWriteSize = rs.getInt(index++);
-               diskWrittenSectorCount = rs.getInt(index++);
+               diskReadOpCount = rs.getInt(index++);
+               diskWriteOpCount = rs.getInt(index++);
+               diskWrittenByteSize = rs.getInt(index++);
                networkSendSize = rs.getInt(index++);
                networkReceiveSize = rs.getInt(index++);
                wifi = rs.getInt(index++);
index 7e11893..5c862b4 100644 (file)
@@ -59,10 +59,10 @@ public class SystemDataDBTable extends DBTable {
                DEVICE_STATUS_VIDEO,
                DEVICE_STATUS_CALL,
                DISK_TOTAL_USAGE,
-               DISK_IO_READ_SIZE,
-               DISK_IO_READ_SECTOR,
-               DISK_IO_WRITE_SIZE,
-               DISK_IO_WRITE_SECTOR,
+               DISK_IO_READ_OP_COUNT,
+               DISK_IO_READ_BYTE_SIZE,
+               DISK_IO_WRITE_OP_COUNT,
+               DISK_IO_WRITE_BYTE_SIZE,
                ENERGY_USAGE,
        }
 
@@ -157,17 +157,16 @@ public class SystemDataDBTable extends DBTable {
                                prep.setInt(19, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_VIDEO.ordinal())));
                                prep.setInt(20, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_CALL.ordinal())));
                                prep.setInt(21, (Integer) (rowData.get(COLUMN.DISK_TOTAL_USAGE.ordinal())));
-                               prep.setInt(22, (Integer) (rowData.get(COLUMN.DISK_IO_READ_SIZE.ordinal())));
-                               prep.setInt(23, (Integer) (rowData.get(COLUMN.DISK_IO_READ_SECTOR.ordinal())));
-                               prep.setInt(24, (Integer) (rowData.get(COLUMN.DISK_IO_WRITE_SIZE.ordinal())));
-                               prep.setInt(25, (Integer) (rowData.get(COLUMN.DISK_IO_WRITE_SECTOR.ordinal())));
+                               prep.setInt(22, (Integer) (rowData.get(COLUMN.DISK_IO_READ_OP_COUNT.ordinal())));
+                               prep.setInt(23, (Integer) (rowData.get(COLUMN.DISK_IO_READ_BYTE_SIZE.ordinal())));
+                               prep.setInt(24, (Integer) (rowData.get(COLUMN.DISK_IO_WRITE_OP_COUNT.ordinal())));
+                               prep.setInt(25, (Integer) (rowData.get(COLUMN.DISK_IO_WRITE_BYTE_SIZE.ordinal())));
                                prep.setInt(26, (Integer) (rowData.get(COLUMN.ENERGY_USAGE.ordinal())));
                        } catch (SQLException e) {
                                e.printStackTrace();
                                isPrepared = false;
                        }
                }
-
                return isPrepared;
        }
 }
index dbf38f3..49bda73 100644 (file)
@@ -46,13 +46,13 @@ import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
 public class DiskIOChart extends TimelineChart {
        private static volatile DiskIOChart instance = null;
 
-       private DAChartSeries readSeries;
-       private DAChartSeries readSectorSeries;
-       private DAChartSeries writeSeries;
-       private DAChartSeries writeSectorSeries;
+       private DAChartSeries readOpCountSeries;
+       private DAChartSeries writeOpCountSeries;
+       private DAChartSeries readByteSizeSeries;
+       private DAChartSeries writeByteSizeSeries;
 
-       private int maxSectorCount = 0;
-       private double maxReadWriteSize = 0;
+       private int maxOpCount = 0;
+       private int maxReadWriteSize = 0;
     
        public static DiskIOChart getInstance() {
                if (instance == null) {
@@ -74,53 +74,53 @@ public class DiskIOChart extends TimelineChart {
                chartIcon = ImageResources.CHART_DISK_IO;
                addIcon = ImageResources.CHART_DISK_IO;
 
-               readSeries = new DAChartSeries(
-                               TimelineChartLabels.DISK_IO_CHART_SERIES_READ,
+               readOpCountSeries = new DAChartSeries(
+                               TimelineChartLabels.DISK_IO_CHART_SERIES_READ_OP_COUNT,
                                DAChartSeries.SERIES_STYLE_BAR, ColorResources.SERIES_COLOR_DISK_IO_READ_BYTE);
-               writeSeries = new DAChartSeries(
-                               TimelineChartLabels.DISK_IO_CHART_SERIES_WRITE,
+               writeOpCountSeries = new DAChartSeries(
+                               TimelineChartLabels.DISK_IO_CHART_SERIES_WRITE_OP_COUNT,
                                DAChartSeries.SERIES_STYLE_BAR, ColorResources.SERIES_COLOR_DISK_IO_WRITE_BYTE);
-               readSectorSeries = new DAChartSeries(
-                               TimelineChartLabels.DISK_IO_CHART_SERIES_READ_SECTOR,
+               readByteSizeSeries = new DAChartSeries(
+                               TimelineChartLabels.DISK_IO_CHART_SERIES_READ_BYTE_SIZE,
                                DAChartSeries.SERIES_STYLE_BAR, ColorResources.SERIES_COLOR_DISK_IO_READ_SECTOR);
-               writeSectorSeries = new DAChartSeries(
-                               TimelineChartLabels.DISK_IO_CHART_SERIES_WRITE_SECTOR,
+               writeByteSizeSeries = new DAChartSeries(
+                               TimelineChartLabels.DISK_IO_CHART_SERIES_WRITE_BYTE_SIZE,
                                DAChartSeries.SERIES_STYLE_BAR, ColorResources.SERIES_COLOR_DISK_IO_READ_WRITE_SECTOR);
                
-               readSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
-               readSectorSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
-               writeSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
-               writeSectorSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
+               readOpCountSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
+               writeOpCountSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
+               readByteSizeSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
+               writeByteSizeSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
        }
 
        @Override
        public DAChartBoardItem createBoardItem(DAChartBoard chartBoard) {
                DAChartBoardItem item = super.createBoardItem(chartBoard);
 
-               chart.addSeries(readSeries);
-               chart.addSeries(writeSeries);
-               chart.addSeries(readSectorSeries);
-               chart.addSeries(writeSectorSeries);
+               chart.addSeries(readOpCountSeries);
+               chart.addSeries(writeOpCountSeries);
+               chart.addSeries(readByteSizeSeries);
+               chart.addSeries(writeByteSizeSeries);
 
                chart.setChartRenderer(new DiskIOChartRenderer());      // need to custom Chart Render for disk io
                chart.getPlot().setAxisUnit("B");
                chart.getPlot().setAxisUnitType(DAChartPlot.UnitType.BINARY);
                chart.getPlot().setShowAxis(true);
                
-               readSeries.setEndY(0);
-               writeSeries.setEndY(0);
-               readSectorSeries.setEndY(0);
-               writeSectorSeries.setEndY(0);
+               readOpCountSeries.setEndY(0);
+               writeOpCountSeries.setEndY(0);
+               readByteSizeSeries.setEndY(0);
+               writeByteSizeSeries.setEndY(0);
 
                return item;
        }
        
        @Override
        public void inputChartSeries(List<Object> dataList) {
-               readSeries.clear();
-               readSectorSeries.clear();
-               writeSeries.clear();
-               writeSectorSeries.clear();
+                       readOpCountSeries.clear();
+                       writeOpCountSeries.clear();
+                       readByteSizeSeries.clear();
+                       writeByteSizeSeries.clear();
                
                @SuppressWarnings("unchecked")
                List<List<Object>> data = (List<List<Object>>)dataList.get(TimelineConstants.SYSTEM_DB_DATA);
@@ -129,36 +129,36 @@ public class DiskIOChart extends TimelineChart {
                        List<Object> row = data.get(i);
                        double time = (Long)row.get(SystemDataDBTable.COLUMN.TIME.ordinal())
                                / TimelineConstants.MEGA_DOUBLE;
-                       int readSize = (Integer)row.get(SystemDataDBTable.COLUMN.DISK_IO_READ_SIZE.ordinal());
-                       int readSectorSize = (Integer)row.get(SystemDataDBTable.COLUMN.DISK_IO_READ_SECTOR.ordinal());
-                       int writeSize = (Integer)row.get(SystemDataDBTable.COLUMN.DISK_IO_WRITE_SIZE.ordinal());
-                       int writeSectorSize = (Integer)row.get(SystemDataDBTable.COLUMN.DISK_IO_WRITE_SECTOR.ordinal());
+                       int readCount = (Integer)row.get(SystemDataDBTable.COLUMN.DISK_IO_READ_OP_COUNT.ordinal());
+                       int writeCount = (Integer)row.get(SystemDataDBTable.COLUMN.DISK_IO_WRITE_OP_COUNT.ordinal());
+                       int readByteSize = (Integer)row.get(SystemDataDBTable.COLUMN.DISK_IO_READ_BYTE_SIZE.ordinal());
+                       int writeByteSize = (Integer)row.get(SystemDataDBTable.COLUMN.DISK_IO_WRITE_BYTE_SIZE.ordinal());
                        
-                               readSeries.addSeriesItem(new DAChartSeriesItem(time, readSize,
-                                       Formatter.toByteFormat(readSize)));
-                               readSectorSeries.addSeriesItem(new DAChartSeriesItem(time, readSectorSize,
-                                               String.valueOf(readSectorSize)));
-                               writeSeries.addSeriesItem(new DAChartSeriesItem(time, writeSize,
-                                       Formatter.toByteFormat(writeSize)));
-                               writeSectorSeries.addSeriesItem(new DAChartSeriesItem(time, writeSectorSize,
-                                               String.valueOf(writeSectorSize)));
+                       readOpCountSeries.addSeriesItem(new DAChartSeriesItem(time, readCount, 
+                                       String.valueOf(readCount)));
+                       writeOpCountSeries.addSeriesItem(new DAChartSeriesItem(time, writeCount,
+                                       String.valueOf(writeCount)));
+                       readByteSizeSeries.addSeriesItem(new DAChartSeriesItem(time, readByteSize,
+                                       Formatter.toByteFormat(readByteSize)));
+                       writeByteSizeSeries.addSeriesItem(new DAChartSeriesItem(time, writeByteSize,
+                                       Formatter.toByteFormat(writeByteSize)));
                                
-                               if (maxReadWriteSize < readSize) {
-                                       maxReadWriteSize = readSize * 1.5;
+                               if (maxOpCount < readCount) {
+                                       maxOpCount = (int)(readCount * 1.1);
                                }
-                               if (maxReadWriteSize < writeSize) {
-                                       maxReadWriteSize = writeSize * 1.5;
+                               if (maxOpCount < writeCount) {
+                                       maxOpCount = (int)(writeCount * 1.1);
                                }
-                               if (maxSectorCount < readSectorSize) {
-                                       maxSectorCount = (int)(readSectorSize * 1.5);
+                               if (maxReadWriteSize < readByteSize) {
+                                       maxReadWriteSize = (int)(readByteSize * 1.1);
                                }
-                               if (maxSectorCount < writeSectorSize) {
-                                       maxSectorCount = (int)(writeSectorSize * 1.5);
+                               if (maxReadWriteSize < writeByteSize) {
+                                       maxReadWriteSize = (int)(writeByteSize * 1.1);
                                }
                }
-               readSeries.setEndY(maxReadWriteSize);
-               writeSeries.setEndY(maxReadWriteSize);
-               readSectorSeries.setEndY(maxSectorCount);
-               writeSectorSeries.setEndY(maxSectorCount);
+               readOpCountSeries.setEndY(maxOpCount);
+               writeOpCountSeries.setEndY(maxOpCount);
+               readByteSizeSeries.setEndY(maxReadWriteSize);
+               writeByteSizeSeries.setEndY(maxReadWriteSize);
        }
 }
index ee91584..d4f3978 100644 (file)
@@ -450,10 +450,10 @@ public class TimelineChartManager extends PageDataManager implements
                                dbSystemData.add(new Integer(log.getVideo()));
                                dbSystemData.add(new Integer(log.getCall()));
                                dbSystemData.add(new Integer(log.getTotalUsedDrive()));
-                               dbSystemData.add(new Integer(log.getDiskReadSize()));
-                               dbSystemData.add(new Integer(log.getDiskReadSectorCount()));
-                               dbSystemData.add(new Integer(log.getDiskWriteSize()));
-                               dbSystemData.add(new Integer(log.getDiskWrittenSectorCount()));
+                               dbSystemData.add(new Integer(log.getDiskReadOpCount()));
+                               dbSystemData.add(new Integer(log.getDiskReadByteSize()));
+                               dbSystemData.add(new Integer(log.getDiskWriteOpCount()));
+                               dbSystemData.add(new Integer(log.getDiskWrittenByteSize()));
                                dbSystemData.add(new Integer(log.getEnergyUsage()));
                                systemDataList.add(dbSystemData);