metrics

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2016 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package metrics provides utilities for registering client metrics to Prometheus.

Index

Constants

This section is empty.

Variables

View Source
var (
	// RequestLatency is a Prometheus Summary metric type partitioned by
	// "verb" and "url" labels. It is used for the rest client latency metrics.
	RequestLatency = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Subsystem: restClientSubsystem,
			Name:      "request_latency_microseconds",
			Help:      "Request latency in microseconds. Broken down by verb and URL",
			MaxAge:    time.Hour,
		},
		[]string{"verb", "url"},
	)

	RequestResult = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Subsystem: restClientSubsystem,
			Name:      "request_status_codes",
			Help:      "Number of http requests, partitioned by metadata",
		},
		[]string{"code", "method", "host"},
	)
)

Functions

func Register

func Register()

Register registers all metrics to Prometheus with respect to the RequestLatency.

func SinceInMicroseconds

func SinceInMicroseconds(start time.Time) float64

Calculates the time since the specified start in microseconds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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