Skip to content

Commit

Permalink
docs: Add note about counter_server_query_cache_hit metric (#4946)
Browse files Browse the repository at this point in the history
Fixes: #4389

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
  • Loading branch information
ashutosh-narkar committed Jul 29, 2022
1 parent eff91f7 commit 462d518
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/content/rest-api.md
Expand Up @@ -2044,6 +2044,12 @@ OPA currently supports the following query performance metrics:
- **timer_rego_module_parse_ns**: time taken (in nanoseconds) to parse the input policy module.
- **timer_rego_module_compile_ns**: time taken (in nanoseconds) to compile the loaded policy modules.
- **timer_server_handler_ns**: time take (in nanoseconds) to handle the API request.
- **counter_server_query_cache_hit**: number of cache hits for the query.

The `counter_server_query_cache_hit` counter gives an indication about whether OPA creates a new Rego query
or it uses a pre-processed query which holds some prepared state to serve the API request. A pre-processed query will be
faster to evaluate since OPA will not have to re-parse or compile it. Hence, when the query is served from the cache
`timer_rego_query_parse_ns` and `timer_rego_query_compile_ns` timers will be omitted from the reported performance metrics.

OPA also supports query instrumentation. To enable query instrumentation,
specify the `instrument=true` query parameter when executing the API call.
Expand Down

0 comments on commit 462d518

Please sign in to comment.