metrics

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	RegoQueryCompile  = "rego_query_compile"
	RegoQueryEval     = "rego_query_eval"
	RegoQueryParse    = "rego_query_parse"
	RegoModuleParse   = "rego_module_parse"
	RegoModuleCompile = "rego_module_compile"
	RegoPartialEval   = "rego_partial_eval"
)

Well-known metric names.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics interface {
	Timer(name string) Timer
	All() map[string]interface{}
	Clear()
}

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

func New

func New() Metrics

New returns a new Metrics object.

type Sample

type Sample interface {
	Value() interface{}
}

Sample defines a common interface to obtain a single metric value.

type Timer

type Timer interface {
	Sample
	Start()
	Stop()
}

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