Skip to content

Commit

Permalink
Adding some logs to print key/value size
Browse files Browse the repository at this point in the history
Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
  • Loading branch information
sgup432 committed Mar 19, 2024
1 parent 61d26cc commit 97b0fa7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public void onMiss() {

public void onCached(Accountable key, BytesReference value) {
totalMetric.inc(key.ramBytesUsed() + value.ramBytesUsed());
System.out.println("key size = " + key.ramBytesUsed());
System.out.println("value size = " + value.ramBytesUsed());
System.out.println("Cached !!! = " + totalMetric.count() + " size = " + (key.ramBytesUsed() + value.ramBytesUsed()));
}

Expand All @@ -79,6 +81,8 @@ public void onRemoval(Accountable key, BytesReference value, boolean evicted) {
dec += value.ramBytesUsed();
}
totalMetric.dec(dec);
System.out.println("key size = " + key.ramBytesUsed());
System.out.println("value size = " + value.ramBytesUsed());
System.out.println("Removed !!! = " + totalMetric.count() + " size = " + dec);
}
}

0 comments on commit 97b0fa7

Please sign in to comment.