Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class BlobCacheMetrics {
public static final String LUCENE_FILE_EXTENSION_ATTRIBUTE_KEY = "file_extension";
public static final String NON_LUCENE_EXTENSION_TO_RECORD = "other";
public static final String BLOB_CACHE_COUNT_OF_EVICTED_REGIONS_TOTAL = "es.blob_cache.count_of_evicted_regions.total";
public static final String SEARCH_ORIGIN_REMOTE_STORAGE_DOWNLOAD_TOOK_TIME = "es.blob_cache.search_origin.download_took_time.total";

private final LongCounter cacheMissCounter;
private final LongCounter evictedCountNonZeroFrequency;
Expand All @@ -43,6 +44,7 @@ public class BlobCacheMetrics {
private final LongAdder missCount = new LongAdder();
private final LongAdder readCount = new LongAdder();
private final LongCounter epochChanges;
private final LongHistogram searchOriginDownloadTime;

public enum CachePopulationReason {
/**
Expand Down Expand Up @@ -100,7 +102,12 @@ public BlobCacheMetrics(MeterRegistry meterRegistry) {
"The time spent copying data into the cache",
"milliseconds"
),
meterRegistry.registerLongCounter("es.blob_cache.epoch.total", "The epoch changes of the LFU cache", "count")
meterRegistry.registerLongCounter("es.blob_cache.epoch.total", "The epoch changes of the LFU cache", "count"),
meterRegistry.registerLongHistogram(
SEARCH_ORIGIN_REMOTE_STORAGE_DOWNLOAD_TOOK_TIME,
"The distribution of time in millis taken to download data from remote storage for search requests",
"milliseconds"
)
);

meterRegistry.registerLongGauge(
Expand Down Expand Up @@ -137,7 +144,8 @@ public BlobCacheMetrics(MeterRegistry meterRegistry) {
DoubleHistogram cachePopulationThroughput,
LongCounter cachePopulationBytes,
LongCounter cachePopulationTime,
LongCounter epochChanges
LongCounter epochChanges,
LongHistogram searchOriginDownloadTime
) {
this.cacheMissCounter = cacheMissCounter;
this.evictedCountNonZeroFrequency = evictedCountNonZeroFrequency;
Expand All @@ -147,6 +155,7 @@ public BlobCacheMetrics(MeterRegistry meterRegistry) {
this.cachePopulationBytes = cachePopulationBytes;
this.cachePopulationTime = cachePopulationTime;
this.epochChanges = epochChanges;
this.searchOriginDownloadTime = searchOriginDownloadTime;
}

public static final BlobCacheMetrics NOOP = new BlobCacheMetrics(TelemetryProvider.NOOP.getMeterRegistry());
Expand All @@ -167,6 +176,10 @@ public LongHistogram getCacheMissLoadTimes() {
return cacheMissLoadTimes;
}

public LongHistogram getSearchOriginDownloadTime() {
return searchOriginDownloadTime;
}

/**
* Record the various cache population metrics after a chunk is copied to the cache
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ public BlobCacheMetrics getBlobCacheMetrics() {
return blobCacheMetrics;
}

public ThreadPool getThreadPool() {
return threadPool;
}

public int getRangeSize() {
return rangeSize;
}
Expand Down