@@ -31,6 +31,7 @@ public class BlobCacheMetrics {
3131 public static final String LUCENE_FILE_EXTENSION_ATTRIBUTE_KEY = "file_extension" ;
3232 public static final String NON_LUCENE_EXTENSION_TO_RECORD = "other" ;
3333 public static final String BLOB_CACHE_COUNT_OF_EVICTED_REGIONS_TOTAL = "es.blob_cache.count_of_evicted_regions.total" ;
34+ public static final String SEARCH_ORIGIN_REMOTE_STORAGE_DOWNLOAD_TOOK_TIME = "es.blob_cache.search_origin.download_took_time.total" ;
3435
3536 private final LongCounter cacheMissCounter ;
3637 private final LongCounter evictedCountNonZeroFrequency ;
@@ -43,6 +44,7 @@ public class BlobCacheMetrics {
4344 private final LongAdder missCount = new LongAdder ();
4445 private final LongAdder readCount = new LongAdder ();
4546 private final LongCounter epochChanges ;
47+ private final LongHistogram searchOriginDownloadTime ;
4648
4749 public enum CachePopulationReason {
4850 /**
@@ -100,7 +102,12 @@ public BlobCacheMetrics(MeterRegistry meterRegistry) {
100102 "The time spent copying data into the cache" ,
101103 "milliseconds"
102104 ),
103- meterRegistry .registerLongCounter ("es.blob_cache.epoch.total" , "The epoch changes of the LFU cache" , "count" )
105+ meterRegistry .registerLongCounter ("es.blob_cache.epoch.total" , "The epoch changes of the LFU cache" , "count" ),
106+ meterRegistry .registerLongHistogram (
107+ SEARCH_ORIGIN_REMOTE_STORAGE_DOWNLOAD_TOOK_TIME ,
108+ "The distribution of time in millis taken to download data from remote storage for search requests" ,
109+ "milliseconds"
110+ )
104111 );
105112
106113 meterRegistry .registerLongGauge (
@@ -137,7 +144,8 @@ public BlobCacheMetrics(MeterRegistry meterRegistry) {
137144 DoubleHistogram cachePopulationThroughput ,
138145 LongCounter cachePopulationBytes ,
139146 LongCounter cachePopulationTime ,
140- LongCounter epochChanges
147+ LongCounter epochChanges ,
148+ LongHistogram searchOriginDownloadTime
141149 ) {
142150 this .cacheMissCounter = cacheMissCounter ;
143151 this .evictedCountNonZeroFrequency = evictedCountNonZeroFrequency ;
@@ -147,6 +155,7 @@ public BlobCacheMetrics(MeterRegistry meterRegistry) {
147155 this .cachePopulationBytes = cachePopulationBytes ;
148156 this .cachePopulationTime = cachePopulationTime ;
149157 this .epochChanges = epochChanges ;
158+ this .searchOriginDownloadTime = searchOriginDownloadTime ;
150159 }
151160
152161 public static final BlobCacheMetrics NOOP = new BlobCacheMetrics (TelemetryProvider .NOOP .getMeterRegistry ());
@@ -167,6 +176,10 @@ public LongHistogram getCacheMissLoadTimes() {
167176 return cacheMissLoadTimes ;
168177 }
169178
179+ public LongHistogram getSearchOriginDownloadTime () {
180+ return searchOriginDownloadTime ;
181+ }
182+
170183 /**
171184 * Record the various cache population metrics after a chunk is copied to the cache
172185 *
0 commit comments