Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
Signed-off-by: Bharathwaj G <[email protected]>
  • Loading branch information
bharath-techie committed Oct 12, 2023
1 parent 49a6bcd commit 984f5b7
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions server/src/main/java/org/opensearch/monitor/fs/FsInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ public static class DeviceStats implements Writeable, ToXContentFragment {
final long previousWritesCompleted;
final long currentSectorsWritten;
final long previousSectorsWritten;
long currentReadTime;
long previousReadTime;
long currentWriteTime;
long previousWriteTime;
long currentQueueSize;
long previousQueueSize;
long currentIOTime;
long previousIOTime;
final long currentReadTime;
final long previousReadTime;
final long currentWriteTime;
final long previousWriteTime;
final long currentQueueSize;
final long previousQueueSize;
final long currentIOTime;
final long previousIOTime;

public DeviceStats(
final int majorDeviceNumber,
Expand Down Expand Up @@ -344,6 +344,15 @@ public DeviceStats(StreamInput in) throws IOException {
previousQueueSize = in.readLong();
currentIOTime = in.readLong();
previousIOTime = in.readLong();
} else {
currentReadTime = 0;
previousReadTime = 0;
currentWriteTime = 0;
previousWriteTime = 0;
currentQueueSize = 0;
previousQueueSize = 0;
currentIOTime = 0;
previousIOTime = 0;
}
}

Expand Down Expand Up @@ -474,10 +483,10 @@ public static class IoStats implements Writeable, ToXContentFragment {
final long totalWriteOperations;
final long totalReadKilobytes;
final long totalWriteKilobytes;
long totalReadTime;
long totalWriteTime;
long totalQueueSize;
long totalIOTimeInMillis;
final long totalReadTime;
final long totalWriteTime;
final long totalQueueSize;
final long totalIOTimeInMillis;

public IoStats(final DeviceStats[] devicesStats) {
this.devicesStats = devicesStats;
Expand Down Expand Up @@ -529,6 +538,11 @@ public IoStats(StreamInput in) throws IOException {
this.totalWriteTime = in.readLong();
this.totalQueueSize = in.readLong();
this.totalIOTimeInMillis = in.readLong();
} else {
this.totalReadTime = 0;
this.totalWriteTime = 0;
this.totalQueueSize = 0;
this.totalIOTimeInMillis = 0;
}
}

Expand Down

0 comments on commit 984f5b7

Please sign in to comment.