metrics

package
v0.0.0-...-5299962 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 1 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 {
	// CountAPICall records API calls to the upstream hosting service.
	CountAPICall(name string)

	// CountFailedAPICall records failed API calls to the upstream hosting service.
	CountFailedAPICall(name string)
}

Interface implementations provide metrics for the system.

type MockMetrics

type MockMetrics struct {
	APICalls       int
	FailedAPICalls int
}

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) CountAPICall

func (m *MockMetrics) CountAPICall(name string)

CountAPICall records outgoing API calls to upstream services.

func (*MockMetrics) CountFailedAPICall

func (m *MockMetrics) CountFailedAPICall(name string)

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 counters.

func (*PrometheusMetrics) CountAPICall

func (m *PrometheusMetrics) CountAPICall(name string)

CountAPICall records outgoing API calls to upstream services.

func (*PrometheusMetrics) CountFailedAPICall

func (m *PrometheusMetrics) CountFailedAPICall(name string)

CountFailedAPICall records failled outgoing API calls to upstream services.

Jump to

Keyboard shortcuts

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