Skip to content

Commit bc43a32

Browse files
authored
Rename blobName to fileName in blob cache metrics (#134357)
We record the lucene file extention when fetching data from the blob store. The method argument was named `blobName` which was confusing. This changes the argument name to `fileName` for clarity.
1 parent e3d7ba3 commit bc43a32

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,28 +170,28 @@ public LongHistogram getCacheMissLoadTimes() {
170170
/**
171171
* Record the various cache population metrics after a chunk is copied to the cache
172172
*
173-
* @param blobName The file that was requested and triggered the cache population.
173+
* @param fileName The actual (lucene) file that's requested from the blob location
174174
* @param bytesCopied The number of bytes copied
175175
* @param copyTimeNanos The time taken to copy the bytes in nanoseconds
176176
* @param cachePopulationReason The reason for the cache being populated
177177
* @param cachePopulationSource The source from which the data is being loaded
178178
*/
179179
public void recordCachePopulationMetrics(
180-
String blobName,
180+
String fileName,
181181
int bytesCopied,
182182
long copyTimeNanos,
183183
CachePopulationReason cachePopulationReason,
184184
CachePopulationSource cachePopulationSource
185185
) {
186-
LuceneFilesExtensions luceneFilesExtensions = LuceneFilesExtensions.fromFile(blobName);
187-
String blobFileExtension = luceneFilesExtensions != null ? luceneFilesExtensions.getExtension() : NON_LUCENE_EXTENSION_TO_RECORD;
186+
LuceneFilesExtensions luceneFilesExtensions = LuceneFilesExtensions.fromFile(fileName);
187+
String luceneFileExt = luceneFilesExtensions != null ? luceneFilesExtensions.getExtension() : NON_LUCENE_EXTENSION_TO_RECORD;
188188
Map<String, Object> metricAttributes = Map.of(
189189
CACHE_POPULATION_REASON_ATTRIBUTE_KEY,
190190
cachePopulationReason.name(),
191191
CACHE_POPULATION_SOURCE_ATTRIBUTE_KEY,
192192
cachePopulationSource.name(),
193193
LUCENE_FILE_EXTENSION_ATTRIBUTE_KEY,
194-
blobFileExtension
194+
luceneFileExt
195195
);
196196
assert bytesCopied > 0 : "We shouldn't be recording zero-sized copies";
197197
cachePopulationBytes.incrementBy(bytesCopied, metricAttributes);

0 commit comments

Comments
 (0)