metrics

package
v0.0.0-...-559cbd0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2016 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Errors tracks http status codes for problematic requests.
	Errors = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "errors_total",
			Help: "Number of upstream errors",
		},
		[]string{"status"},
	)

	// Func tracks time spent in a function.
	Func = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name: "function_microseconds",
			Help: "function timing.",
		},
		[]string{"route"},
	)

	// DB tracks timing of interactions with the file system.
	DB = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name: "db_microseconds",
			Help: "db timing.",
		},
		[]string{"what"},
	)
)

Functions

func DBTime

func DBTime(name string) func()

DBTime makes it simple to add one-line timings to db interactions.

func Time

func Time() func()

Time is a function that makes it simple to add one-line timings to function calls.

Types

This section is empty.

Jump to

Keyboard shortcuts

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