metrics

package
v0.0.0-...-f440afa Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recorder

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

Recorder is a struct for recording GitOps Toolkit metrics for a controller.

Use NewRecorder to initialise it with properly configured metric names.

func (*Recorder) Collectors

func (r *Recorder) Collectors() []prometheus.Collector

Collectors returns a slice of Prometheus collectors, which can be used to register them in a metrics registry.

func (*Recorder) RecordDuration

func (r *Recorder) RecordDuration(name string, namespace string, start time.Time)

RecordDuration records the duration since start for the given ref.

func (*Recorder) RecordStatus

func (r *Recorder) RecordStatus(name string, namespace string, status v1alpha1.TerraformRunStatus)

RecordStatus records the status for a given terraform workflow/run

func (*Recorder) RecordTotal

func (r *Recorder) RecordTotal(name string, namespace string)

RecordTotal records the total number of submitted workflows

type RecorderInterface

type RecorderInterface interface {
	RecordTotal(name string, namespace string)
	RecordStatus(name string, namespace string, status v1alpha1.TerraformRunStatus)
	RecordDuration(name string, namespace string, start time.Time)
	Collectors() []prometheus.Collector
}

RecorderInterface is an interface that holds the functions used by the recorder struct

func NewRecorder

func NewRecorder() RecorderInterface

NewRecorder returns a new Recorder with all metric names configured confirm GitOps Toolkit standards.

Jump to

Keyboard shortcuts

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