opa: github.com/open-policy-agent/opa/metrics Index | Files

package metrics

import "github.com/open-policy-agent/opa/metrics"

Package metrics contains helpers for performance metric management inside the policy engine.


Package Files



const (
    ServerHandler       = "server_handler"
    ServerQueryCacheHit = "server_query_cache_hit"
    RegoQueryCompile    = "rego_query_compile"
    RegoQueryEval       = "rego_query_eval"
    RegoQueryParse      = "rego_query_parse"
    RegoModuleParse     = "rego_module_parse"
    RegoDataParse       = "rego_data_parse"
    RegoModuleCompile   = "rego_module_compile"
    RegoPartialEval     = "rego_partial_eval"
    RegoInputParse      = "rego_input_parse"
    RegoLoadFiles       = "rego_load_files"
    RegoLoadBundles     = "rego_load_bundles"

Well-known metric names.

type Counter Uses

type Counter interface {
    Value() interface{}

Counter defines the interface for a monotonic increasing counter.

type Histogram Uses

type Histogram interface {
    Value() interface{}

Histogram defines the interface for a histogram with hardcoded percentiles.

type Info Uses

type Info struct {
    Name string `json:"name"` // name is a unique human-readable identifier for the provider.

Info contains attributes describing the underlying metrics provider.

type Metrics Uses

type Metrics interface {
    Info() Info
    Timer(name string) Timer
    Histogram(name string) Histogram
    Counter(name string) Counter
    All() map[string]interface{}

Metrics defines the interface for a collection of performance metrics in the policy engine.

func New Uses

func New() Metrics

New returns a new Metrics object.

type Timer Uses

type Timer interface {
    Value() interface{}
    Int64() int64
    Stop() int64

Timer defines the interface for a restartable timer that accumulates elapsed time.

Package metrics imports 8 packages (graph) and is imported by 55 packages. Updated 2019-12-19. Refresh now. Tools for package owners.