metrics

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Package metrics is a generated GoMock package.

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Index

Constants

This section is empty.

Variables

View Source
var (

	// Common counters across os distributions
	DropCounter         IGaugeVec
	DropBytesCounter    IGaugeVec
	ForwardCounter      IGaugeVec
	ForwardBytesCounter IGaugeVec

	WindowsCounter IGaugeVec

	// Common gauges across os distributions
	NodeConnectivityStatusGauge  IGaugeVec
	NodeConnectivityLatencyGauge IGaugeVec

	// TCP Stats
	TCPStateGauge            IGaugeVec
	TCPConnectionRemoteGauge IGaugeVec
	TCPConnectionStats       IGaugeVec
	TCPFlagCounters          IGaugeVec

	// IP States
	IPConnectionStats IGaugeVec

	// UDP Stats
	UDPConnectionStats      IGaugeVec
	UDPActiveSocketsCounter IGaugeVec

	// Interface Stats
	InterfaceStats IGaugeVec

	// Control Plane Metrics
	PluginManagerFailedToReconcileCounter ICounterVec
	LostEventsCounter                     ICounterVec

	// DNS Metrics.
	DNSRequestCounter  ICounterVec
	DNSResponseCounter ICounterVec
)

Metric Counters

Functions

func GetCounterValue

func GetCounterValue(m prometheus.Counter) float64

GetCounterValue returns the current value stored for the counter

func InitializeMetrics

func InitializeMetrics()

Initiates and creates the common metrics

func ToPrometheusType

func ToPrometheusType(metric interface{}) prometheus.Collector

Types

type ICounterVec

type ICounterVec interface {
	WithLabelValues(lvs ...string) prometheus.Counter
	GetMetricWithLabelValues(lvs ...string) (prometheus.Counter, error)
}

type IGaugeVec

type IGaugeVec interface {
	WithLabelValues(lvs ...string) prometheus.Gauge
	GetMetricWithLabelValues(lvs ...string) (prometheus.Gauge, error)
}

type IHistogramVec

type IHistogramVec interface {
	Observe(float64)
	// Keep the Write method for testing purposes.
	Write(*dto.Metric) error
}

type MockICounterVec

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

MockICounterVec is a mock of ICounterVec interface.

func NewMockICounterVec

func NewMockICounterVec(ctrl *gomock.Controller) *MockICounterVec

NewMockICounterVec creates a new mock instance.

func (*MockICounterVec) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockICounterVec) GetMetricWithLabelValues

func (m *MockICounterVec) GetMetricWithLabelValues(lvs ...string) (prometheus.Counter, error)

GetMetricWithLabelValues mocks base method.

func (*MockICounterVec) WithLabelValues

func (m *MockICounterVec) WithLabelValues(lvs ...string) prometheus.Counter

WithLabelValues mocks base method.

type MockICounterVecMockRecorder

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

MockICounterVecMockRecorder is the mock recorder for MockICounterVec.

func (*MockICounterVecMockRecorder) GetMetricWithLabelValues

func (mr *MockICounterVecMockRecorder) GetMetricWithLabelValues(lvs ...any) *gomock.Call

GetMetricWithLabelValues indicates an expected call of GetMetricWithLabelValues.

func (*MockICounterVecMockRecorder) WithLabelValues

func (mr *MockICounterVecMockRecorder) WithLabelValues(lvs ...any) *gomock.Call

WithLabelValues indicates an expected call of WithLabelValues.

type MockIGaugeVec

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

MockIGaugeVec is a mock of IGaugeVec interface.

func NewMockIGaugeVec

func NewMockIGaugeVec(ctrl *gomock.Controller) *MockIGaugeVec

NewMockIGaugeVec creates a new mock instance.

func (*MockIGaugeVec) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIGaugeVec) GetMetricWithLabelValues

func (m *MockIGaugeVec) GetMetricWithLabelValues(lvs ...string) (prometheus.Gauge, error)

GetMetricWithLabelValues mocks base method.

func (*MockIGaugeVec) WithLabelValues

func (m *MockIGaugeVec) WithLabelValues(lvs ...string) prometheus.Gauge

WithLabelValues mocks base method.

type MockIGaugeVecMockRecorder

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

MockIGaugeVecMockRecorder is the mock recorder for MockIGaugeVec.

func (*MockIGaugeVecMockRecorder) GetMetricWithLabelValues

func (mr *MockIGaugeVecMockRecorder) GetMetricWithLabelValues(lvs ...any) *gomock.Call

GetMetricWithLabelValues indicates an expected call of GetMetricWithLabelValues.

func (*MockIGaugeVecMockRecorder) WithLabelValues

func (mr *MockIGaugeVecMockRecorder) WithLabelValues(lvs ...any) *gomock.Call

WithLabelValues indicates an expected call of WithLabelValues.

type MockIHistogramVec

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

MockIHistogramVec is a mock of IHistogramVec interface.

func NewMockIHistogramVec

func NewMockIHistogramVec(ctrl *gomock.Controller) *MockIHistogramVec

NewMockIHistogramVec creates a new mock instance.

func (*MockIHistogramVec) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIHistogramVec) Observe

func (m *MockIHistogramVec) Observe(arg0 float64)

Observe mocks base method.

func (*MockIHistogramVec) Write

Write mocks base method.

type MockIHistogramVecMockRecorder

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

MockIHistogramVecMockRecorder is the mock recorder for MockIHistogramVec.

func (*MockIHistogramVecMockRecorder) Observe

func (mr *MockIHistogramVecMockRecorder) Observe(arg0 any) *gomock.Call

Observe indicates an expected call of Observe.

func (*MockIHistogramVecMockRecorder) Write

func (mr *MockIHistogramVecMockRecorder) Write(arg0 any) *gomock.Call

Write indicates an expected call of Write.

Jump to

Keyboard shortcuts

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