package metrics
import "github.com/open-policy-agent/opa/metrics"
Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. For newer features and behaviours, such as defaulting to the Rego v1 syntax, use the corresponding components in the github.com/open-policy-agent/opa/v1 package instead. See https://www.openpolicyagent.org/docs/latest/v0-compatibility/ for more information.
Package metrics contains helpers for performance metric management inside the policy engine.
Index ¶
- Constants
- func Statistics(num ...int64) interface{}
- type Counter
- type Histogram
- type Info
- type Metrics
- type Timer
- type TimerMetrics
Constants ¶
const ( BundleRequest = v1.BundleRequest ServerHandler = v1.ServerHandler ServerQueryCacheHit = v1.ServerQueryCacheHit SDKDecisionEval = v1.SDKDecisionEval RegoQueryCompile = v1.RegoQueryCompile RegoQueryEval = v1.RegoQueryEval RegoQueryParse = v1.RegoQueryParse RegoModuleParse = v1.RegoModuleParse RegoDataParse = v1.RegoDataParse RegoModuleCompile = v1.RegoModuleCompile RegoPartialEval = v1.RegoPartialEval RegoInputParse = v1.RegoInputParse RegoLoadFiles = v1.RegoLoadFiles RegoLoadBundles = v1.RegoLoadBundles RegoExternalResolve = v1.RegoExternalResolve )
Well-known metric names.
Functions ¶
func Statistics ¶
func Statistics(num ...int64) interface{}
Types ¶
type Counter ¶
Counter defines the interface for a monotonic increasing counter.
type Histogram ¶
Histogram defines the interface for a histogram with hardcoded percentiles.
type Info ¶
Info contains attributes describing the underlying metrics provider.
type Metrics ¶
Metrics defines the interface for a collection of performance metrics in the policy engine.
func New ¶
func New() Metrics
New returns a new Metrics object.
type Timer ¶
Timer defines the interface for a restartable timer that accumulates elapsed time.
type TimerMetrics ¶
type TimerMetrics = v1.TimerMetrics
Source Files ¶
- Version
- v1.4.2 (latest)
- Published
- May 2, 2025
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 4 hours ago –
Tools for package owners.