metrics

package
v0.17.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2020 License: Apache-2.0 Imports: 8 Imported by: 46 modules, 132 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

Index

Constants

View Source
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.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter added in v0.7.0

type Counter interface {
	Value() interface{}
	Incr()
}

Counter defines the interface for a monotonic increasing counter.

type Histogram added in v0.7.0

type Histogram interface {
	Value() interface{}
	Update(int64)
}

Histogram defines the interface for a histogram with hardcoded percentiles.

type Info added in v0.14.0

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

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

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

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL