Skip to content

Commit

Permalink
Changing bytesLag to BytesValue instead of TimeValue
Browse files Browse the repository at this point in the history
Signed-off-by: Shourya Dutta Biswas <114977491+shourya035@users.noreply.github.com>
  • Loading branch information
shourya035 committed Aug 8, 2023
1 parent 2663bf8 commit 3ac12e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
builder.humanReadableField(Fields.VERSION_MAP_MEMORY_IN_BYTES, Fields.VERSION_MAP_MEMORY, getVersionMapMemory());
builder.humanReadableField(Fields.FIXED_BIT_SET_MEMORY_IN_BYTES, Fields.FIXED_BIT_SET, getBitsetMemory());
builder.field(Fields.MAX_UNSAFE_AUTO_ID_TIMESTAMP, maxUnsafeAutoIdTimestamp);
if (remoteSegmentStats != null) {
remoteSegmentStats.toXContent(builder, params);
}
remoteSegmentStats.toXContent(builder, params);
builder.startObject(Fields.FILE_SIZES);
for (Map.Entry<String, Long> entry : fileSizes.entrySet()) {
builder.startObject(entry.getKey());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public long getMaxRefreshBytesLag() {
}

public void setMaxRefreshBytesLag(long maxRefreshBytesLag) {
this.maxRefreshBytesLag = Math.max(this.maxRefreshBytesLag, maxRefreshBytesLag);
this.maxRefreshBytesLag = maxRefreshBytesLag;
}

public void add(RemoteSegmentStats remoteSegmentStats) {
Expand All @@ -130,8 +130,8 @@ public void buildRemoteSegmentStats(RemoteSegmentTransferTracker.Stats trackerSt
this.downloadBytesSucceeded = trackerStats.directoryFileTransferTrackerStats.transferredBytesSucceeded;
this.downloadBytesStarted = trackerStats.directoryFileTransferTrackerStats.transferredBytesStarted;
this.downloadBytesFailed = trackerStats.directoryFileTransferTrackerStats.transferredBytesFailed;
this.maxRefreshTimeLag = Math.max(this.maxRefreshTimeLag, trackerStats.refreshTimeLagMs);
this.maxRefreshBytesLag = Math.max(this.maxRefreshBytesLag, trackerStats.bytesLag);
this.maxRefreshTimeLag = trackerStats.refreshTimeLagMs;
this.maxRefreshBytesLag = trackerStats.bytesLag;
}

@Override
Expand All @@ -156,7 +156,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
builder.humanReadableField(Fields.FAILED_BYTES, Fields.FAILED, new ByteSizeValue(uploadBytesFailed));
builder.endObject();
builder.humanReadableField(Fields.MAX_REFRESH_TIME_LAG_IN_MILLIS, Fields.MAX_REFRESH_TIME_LAG, new TimeValue(maxRefreshTimeLag));
builder.humanReadableField(Fields.MAX_REFRESH_BYTES_LAG_IN_MILLIS, Fields.MAX_REFRESH_BYTES_LAG, new TimeValue(maxRefreshBytesLag));
builder.humanReadableField(Fields.MAX_REFRESH_SIZE_LAG_IN_MILLIS, Fields.MAX_REFRESH_SIZE_LAG, new ByteSizeValue(maxRefreshBytesLag));
builder.endObject();
builder.startObject(Fields.DOWNLOAD);
builder.startObject(Fields.TOTAL_DOWNLOADS);
Expand All @@ -183,7 +183,7 @@ static final class Fields {
static final String SUCCEEDED_BYTES = "succeeded_bytes";
static final String MAX_REFRESH_TIME_LAG = "max_refresh_time_lag";
static final String MAX_REFRESH_TIME_LAG_IN_MILLIS = "max_refresh_time_lag_in_millis";
static final String MAX_REFRESH_BYTES_LAG = "max_refresh_bytes_lag";
static final String MAX_REFRESH_BYTES_LAG_IN_MILLIS = "max_refresh_bytes_lag_in_millis";
static final String MAX_REFRESH_SIZE_LAG = "max_refresh_size_lag";
static final String MAX_REFRESH_SIZE_LAG_IN_MILLIS = "max_refresh_size_lag_in_bytes";
}
}

0 comments on commit 3ac12e9

Please sign in to comment.