metric

package
v0.0.0-...-52b973c Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelHost      = "host"
	LabelIsError   = "is_error"
	LabelNamespace = "namespace"
	LabelSet       = "set"
	LabelOperation = "operation"
)

Variables

This section is empty.

Functions

func IsError

func IsError(err error) string

IsError is a trivial helper for minimize repetitive checks for error values. It passing appropriate numbers to metrics.

func SinceMs

func SinceMs(started time.Time) float64

SinceMs just wraps time.Since() with converting result to milliseconds. Because Prometheus prefers milliseconds.

Types

type Metric

type Metric interface {
	ObserveRT(labels map[string]string, timeSince float64)
	RegisterHit(labels map[string]string)
	RegisterMiss(labels map[string]string)
	IncreaseItemCount(set string)
	SetItemCount(set string, n int)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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