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;
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);
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() {
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);
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++);
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) {
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);
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);
}
}