Benchmark Rego query
rego_benchBenchmark Rego queries against policies and input to detect slow rules. Returns statistical timing data including iterations and nanoseconds per operation.
Instructions
Benchmark a Rego query against a policy + input with opa bench. Returns statistical timing data: iterations, ns/op, and allocation counts. Use this to spot slow rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Rego query to benchmark. | |
| paths | No | Policy / data paths to load. Each must be in an allowed root. | |
| input | No | Inline input document. | |
| inputPath | No | Path to a JSON input file. | |
| count | No | Number of benchmark iterations. Defaults to OPA's built-in default. |