metrics

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Static  = "static"
	Dynamic = "dynamic"
)

Topology types.

View Source
const (
	Success     = prom.Success
	OkIgnored   = "ok_ignored"
	ErrValidate = "err_validate"
	ErrCommit   = "err_commit"
)

Result labels.

View Source
const Namespace = "itopo"

Namespace is the metrics namespace for the infra topology module.

Variables

View Source
var (
	// Current is the single-instance struct to get prometheus gauges.
	Current = newCurrent()
	// Updates is the single-instance struct to get prometheus counters and gauges.
	Updates = newUpdates()
)

Functions

func Expiry

func Expiry(ts time.Time) float64

Expiry returns the expiry time as unix time in seconds. In case of the zero value, +inf is returned.

func Timestamp

func Timestamp(ts time.Time) float64

Timestamp returns the time as unix time in seconds.

Types

type CurrentLabels

type CurrentLabels struct {
	Type string
}

CurrentLabels defines the current topology label set.

func (CurrentLabels) Labels

func (l CurrentLabels) Labels() []string

Labels returns the name of the labels in correct order.

func (CurrentLabels) Values

func (l CurrentLabels) Values() []string

Values returns the values of the label in correct order.

type UpdateLabels

type UpdateLabels struct {
	Type, Result string
}

UpdateLabels defines the update label set.

func (UpdateLabels) Labels

func (l UpdateLabels) Labels() []string

Labels returns the name of the labels in correct order.

func (UpdateLabels) Values

func (l UpdateLabels) Values() []string

Values returns the values of the label in correct order.

func (UpdateLabels) WithResult

func (l UpdateLabels) WithResult(result string) UpdateLabels

WithResult returns the label set with the modified result.

Jump to

Keyboard shortcuts

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