metrics

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockPrometheusInterface

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

Mock of PrometheusInterface interface

func NewMockPrometheusInterface

func NewMockPrometheusInterface(ctrl *gomock.Controller) *MockPrometheusInterface

func (*MockPrometheusInterface) EXPECT

func (_m *MockPrometheusInterface) EXPECT() *_MockPrometheusInterfaceRecorder

func (*MockPrometheusInterface) UpdateFileSuccess

func (_m *MockPrometheusInterface) UpdateFileSuccess(_param0 string, _param1 bool)

func (*MockPrometheusInterface) UpdateRunLatency

func (_m *MockPrometheusInterface) UpdateRunLatency(_param0 float64, _param1 bool)

type Prometheus

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

Prometheus implements instrumentation of metrics for kube-applier. fileApplyCount is a Counter vector to increment the number of successful and failed apply attempts for each file in the repo. runLatency is a Summary vector that keeps track of the duration for apply runs.

func (*Prometheus) GetHandler

func (p *Prometheus) GetHandler() http.Handler

GetHandler returns a handler for exposing Prometheus metrics via HTTP.

func (*Prometheus) Init

func (p *Prometheus) Init()

Init creates and registers the custom metrics for kube-applier.

func (*Prometheus) UpdateFileSuccess

func (p *Prometheus) UpdateFileSuccess(file string, success bool)

UpdateFileSuccess increments the given file's Counter for either successful apply attempts or failed apply attempts.

func (*Prometheus) UpdateRunLatency

func (p *Prometheus) UpdateRunLatency(runLatency float64, success bool)

UpdateRunLatency adds a data point (latency of the most recent run) to the run_latency_seconds Summary metric, with a tag indicating whether or not the run was successful.

type PrometheusInterface

type PrometheusInterface interface {
	UpdateFileSuccess(string, bool)
	UpdateRunLatency(float64, bool)
}

PrometheusInterface allows for mocking out the functionality of Prometheus when testing the full process of an apply run.

Jump to

Keyboard shortcuts

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