Skip to content

Commit 2c990ec

Browse files
Expose the miss count internally for testing
1 parent bfbced6 commit 2c990ec

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/BlobCacheMetrics.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ public long readCount() {
213213
return readCount.sum();
214214
}
215215

216+
public long missCount() {
217+
return missCount.sum();
218+
}
216219
/**
217220
* Calculate throughput as MiB/second
218221
*

x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,8 @@ public Stats getStats() {
741741
writeCount.sum(),
742742
writeBytes.sum(),
743743
blobCacheMetrics.readCount(),
744-
readBytes.sum()
744+
readBytes.sum(),
745+
blobCacheMetrics.missCount()
745746
);
746747
}
747748

@@ -1575,9 +1576,11 @@ public record Stats(
15751576
long writeCount,
15761577
long writeBytes,
15771578
long readCount,
1578-
long readBytes
1579+
long readBytes,
1580+
// miss-count not exposed in REST API for now
1581+
long missCount
15791582
) {
1580-
public static final Stats EMPTY = new Stats(0, 0L, 0L, 0L, 0L, 0L, 0L, 0L);
1583+
public static final Stats EMPTY = new Stats(0, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L);
15811584
}
15821585

15831586
private class LFUCache implements Cache<KeyType, CacheFileRegion<KeyType>> {

0 commit comments

Comments
 (0)