Skip to content

Add query cache hit count and field data cache hit count to rest API  #48645

@clandry94

Description

@clandry94

Describe the feature:

I was investigating cache hit ratios in Elasticsearch clusters recently and noticed that the request_cache has a hit_count and miss_count exposed through the rest API but the query_cache and fielddata cache do not as seen h ere

table.addCell("fielddata.memory_size", "alias:fm,fielddataMemory;default:false;text-align:right;desc:used fielddata cache");
table.addCell("fielddata.evictions", "alias:fe,fielddataEvictions;default:false;text-align:right;desc:fielddata evictions");
table.addCell("query_cache.memory_size", "alias:qcm,queryCacheMemory;default:false;text-align:right;desc:used query cache");
table.addCell("query_cache.evictions", "alias:qce,queryCacheEvictions;default:false;text-align:right;desc:query cache evictions");
table.addCell("request_cache.memory_size", "alias:rcm,requestCacheMemory;default:false;text-align:right;desc:used request cache");
table.addCell("request_cache.evictions",
"alias:rce,requestCacheEvictions;default:false;text-align:right;desc:request cache evictions");
table.addCell("request_cache.hit_count",
"alias:rchc,requestCacheHitCount;default:false;text-align:right;desc:request cache hit counts");
table.addCell("request_cache.miss_count",
"alias:rcmc,requestCacheMissCount;default:false;text-align:right;desc:request cache miss counts");
.

The values seem to be available within the QueryCacheStats class but not FieldDataStats class so would it make sense to make the QueryCache rest API on parity to the RequestCache rest API? Also having the field data cache hit and miss counts would be very useful as well but seems to be a bit more work to implement.

I can implement these features if it would be useful

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions