Skip to content

Commit

Permalink
Fix condition and parameter order for field cache utilization metric
Browse files Browse the repository at this point in the history
Signed-off-by: Lukáš Vlček <lukas.vlcek@aiven.io>
  • Loading branch information
lukas-vlcek committed Apr 16, 2024
1 parent 8bd0ad9 commit feb966c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/main/java/org/opensearch/monitor/fs/FsInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
if (fileCacheReserved != -1) {
builder.humanReadableField(Fields.CACHE_RESERVED_IN_BYTES, Fields.CACHE_RESERVED, getFileCacheReserved());
}
if (fileCacheReserved != 0) {
builder.humanReadableField(Fields.CACHE_UTILIZED, Fields.CACHE_UTILIZED_IN_BYTES, getFileCacheUtilized());
if (fileCacheUtilized != 0) {
builder.humanReadableField(Fields.CACHE_UTILIZED_IN_BYTES, Fields.CACHE_UTILIZED, getFileCacheUtilized());

Check warning on line 215 in server/src/main/java/org/opensearch/monitor/fs/FsInfo.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/org/opensearch/monitor/fs/FsInfo.java#L215

Added line #L215 was not covered by tests
}

builder.endObject();
Expand Down

0 comments on commit feb966c

Please sign in to comment.