Skip to content

Commit

Permalink
Add a note on QueryCacheHits and QueryCacheMisses in the release …
Browse files Browse the repository at this point in the history
…notes (#16299)

Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui authored Jul 1, 2024
1 parent 2c468b2 commit e827f6b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
8 changes: 6 additions & 2 deletions changelog/20.0/20.0.0/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,12 @@ You can now run `VDiff`s on OnlineDDL schema change migrations, which are not ye

VTTablet exposes two new counter stats:

* `QueryCacheHits`: Query engine query cache hits
* `QueryCacheMisses`: Query engine query cache misses
* `QueryCacheHits`: Query engine query plan cache hits
* `QueryCacheMisses`: Query engine query plan cache misses

> [!NOTE]
> `QueryCache` does not refer to a query cache, but to a query plan cache.
> In v21, these metrics will be deprecated and renamed.
### <a id="vttablet-query-text-characters-processed"/>VTTablet Query Text Characters Processed

Expand Down
8 changes: 6 additions & 2 deletions changelog/20.0/20.0.0/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,12 @@ You can now run `VDiff`s on OnlineDDL schema change migrations, which are not ye

VTTablet exposes two new counter stats:

* `QueryCacheHits`: Query engine query cache hits
* `QueryCacheMisses`: Query engine query cache misses
* `QueryCacheHits`: Query engine query plan cache hits
* `QueryCacheMisses`: Query engine query plan cache misses

> [!NOTE]
> `QueryCache` does not refer to a query cache, but to a query plan cache.
> In v21, these metrics will be deprecated and renamed.
### <a id="vttablet-query-text-characters-processed"/>VTTablet Query Text Characters Processed

Expand Down
12 changes: 6 additions & 6 deletions go/vt/vttablet/tabletserver/query_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,22 +269,22 @@ func NewQueryEngine(env tabletenv.Env, se *schema.Engine) *QueryEngine {
env.Exporter().NewGaugeFunc("StreamBufferSize", "Query engine stream buffer size", qe.streamBufferSize.Load)
env.Exporter().NewCounterFunc("TableACLExemptCount", "Query engine table ACL exempt count", qe.tableaclExemptCount.Load)

env.Exporter().NewGaugeFunc("QueryCacheLength", "Query engine query cache length", func() int64 {
env.Exporter().NewGaugeFunc("QueryCacheLength", "Query engine query plan cache length", func() int64 {
return int64(qe.plans.Len())
})
env.Exporter().NewGaugeFunc("QueryCacheSize", "Query engine query cache size", func() int64 {
env.Exporter().NewGaugeFunc("QueryCacheSize", "Query engine query plan cache size", func() int64 {
return int64(qe.plans.UsedCapacity())
})
env.Exporter().NewGaugeFunc("QueryCacheCapacity", "Query engine query cache capacity", func() int64 {
env.Exporter().NewGaugeFunc("QueryCacheCapacity", "Query engine query plan cache capacity", func() int64 {
return int64(qe.plans.MaxCapacity())
})
env.Exporter().NewCounterFunc("QueryCacheEvictions", "Query engine query cache evictions", func() int64 {
env.Exporter().NewCounterFunc("QueryCacheEvictions", "Query engine query plan cache evictions", func() int64 {
return qe.plans.Metrics.Evicted()
})
qe.queryCacheHits = env.Exporter().NewCounterFunc("QueryCacheHits", "Query engine query cache hits", func() int64 {
qe.queryCacheHits = env.Exporter().NewCounterFunc("QueryCacheHits", "Query engine query plan cache hits", func() int64 {
return qe.plans.Metrics.Hits()
})
qe.queryCacheMisses = env.Exporter().NewCounterFunc("QueryCacheMisses", "Query engine query cache misses", func() int64 {
qe.queryCacheMisses = env.Exporter().NewCounterFunc("QueryCacheMisses", "Query engine query plan cache misses", func() int64 {
return qe.plans.Metrics.Misses()
})

Expand Down

0 comments on commit e827f6b

Please sign in to comment.