metrics

package
v0.0.0-...-fb58021 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsNamespace = "httpserver"
)

Variables

This section is empty.

Functions

func CreateExecutionTimeMetric

func CreateExecutionTimeMetric(namespace string, help string) *prometheus.HistogramVec

CreateExecutionTimeMetric prepares a new histogram labeled with execution step

func Register

func Register()

Types

type ExecutionTimer

type ExecutionTimer struct {
	// contains filtered or unexported fields
}

ExecutionTimer measures execution time of a computation, split into major steps usual usage pattern is: timer := NewExecutionTimer(...) ; compute ; timer.ObserveStep() ; ... ; timer.ObserveTotal()

func NewExecutionTimer

func NewExecutionTimer(histo *prometheus.HistogramVec) *ExecutionTimer

NewExecutionTimer provides a timer for admission latency; call ObserveXXX() on it to measure

func NewTimer

func NewTimer() *ExecutionTimer

NewExecutionTimer provides a timer for Updater's RunOnce execution

func (*ExecutionTimer) ObserveTotal

func (t *ExecutionTimer) ObserveTotal()

ObserveTotal measures the execution time from the creation of the ExecutionTimer

Jump to

Keyboard shortcuts

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