metricobserver

package
v0.0.0-...-a0d7459 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2017 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package metricobserver provides an implementation of apiserver/observer.ObserverFactory that maintains Prometheus metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewObserverFactory

func NewObserverFactory(config Config) (observer.ObserverFactory, error)

NewObserverFactory returns a function that, when called, returns a new Observer. NewObserverFactory registers the API request metrics, and each Observer updates those metrics.

Types

type Config

type Config struct {
	// Clock is the clock to use for all time-related operations.
	Clock clock.Clock

	// PrometheusRegisterer is the prometheus.Registerer in which metric
	// collectors will be registered.
	PrometheusRegisterer prometheus.Registerer
}

Config contains the configuration for an Observer.

func (Config) Validate

func (cfg Config) Validate() error

Validate validates the observer factory configuration.

type Observer

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

Observer is an API server request observer that collects Prometheus metrics.

func (*Observer) Join

func (*Observer) Join(req *http.Request, connectionID uint64)

Join is part of the observer.Observer interface.

func (*Observer) Leave

func (*Observer) Leave()

Leave is part of the observer.Observer interface.

func (*Observer) Login

func (*Observer) Login(entity names.Tag, _ names.ModelTag, _ bool, _ string)

Login is part of the observer.Observer interface.

func (*Observer) RPCObserver

func (o *Observer) RPCObserver() rpc.Observer

RPCObserver is part of the observer.Observer interface.

Jump to

Keyboard shortcuts

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