metrics

package
v0.0.0-...-4cf64ee Latest Latest
Warning

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

Go to latest
Published: Oct 23, 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 Interface

type Interface interface {
	// Record records all the metrics summarised from an engine Sync.
	Record([]common.ResourceSyncResult)
	// CountError tracks errors.
	CountError()
}

Interface implementations provide metrics for the system.

type MockMetrics

type MockMetrics struct {
	Synced       int64
	SyncFailed   int64
	Pruned       int64
	PruneSkipped int64
	Errors       int64
	// contains filtered or unexported fields
}

MockMetrics is a type that provides a simple counter for metrics for test purposes.

func NewMock

func NewMock() *MockMetrics

NewMock creates and returns a MockMetrics.

func (*MockMetrics) CountError

func (p *MockMetrics) CountError()

func (*MockMetrics) Record

func (p *MockMetrics) Record(r []common.ResourceSyncResult)

CountFailedAPICall records failed outgoing API calls to upstream services.

type PrometheusMetrics

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

PrometheusMetrics is a wrapper around Prometheus metrics for counting events in the system.

func New

New creates and returns a PrometheusMetrics initialised with prometheus gauges.

func (*PrometheusMetrics) CountError

func (m *PrometheusMetrics) CountError()

CountError counts the number of errors during synchronisation.

func (*PrometheusMetrics) Record

Record is an implementation of the metrics Interface.

Jump to

Keyboard shortcuts

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