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 ¶
MockMetrics is a type that provides a simple counter for metrics for test purposes.
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 ¶
func New(ns string, reg prometheus.Registerer) *PrometheusMetrics
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.
Click to show internal directories.
Click to hide internal directories.