metrics

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package metrics provides the functionality to create custom metrics for applications

Package metrics is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCounter added in v1.0.0

func NewCounter(m Metric, name, help string, labels ...string) error

NewCounter adds new custom counter metric

func NewGauge added in v1.0.0

func NewGauge(m Metric, name, help string, labels ...string) error

NewGauge adds new custom Gauge metric

func NewHistogram added in v1.0.0

func NewHistogram(m Metric, name, help string, buckets []float64, labels ...string) error

NewHistogram adds new custom Histogram metric

func NewSummary added in v1.0.0

func NewSummary(m Metric, name, help string, labels ...string) error

NewSummary add new custom Summary metric

Types

type Metric added in v1.0.0

type Metric interface {
	// IncCounter increments the value of counter by one
	IncCounter(name string, labels ...string) error
	// AddCounter adds specified value in counter
	AddCounter(name string, val float64, labels ...string) error
	// ObserveHistogram creates observation of Histogram for specified value
	ObserveHistogram(name string, val float64, labels ...string) error
	// SetGauge sets the specific value in Gauge
	SetGauge(name string, val float64, labels ...string) error
	// ObserveSummary creates observation of Summary for specified value
	ObserveSummary(name string, val float64, labels ...string) error
}

Metric provides support of custom metric

func NewMetric added in v1.0.0

func NewMetric() Metric

NewMetric factory function for custom metric

type MockMetric added in v1.0.0

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

MockMetric is a mock of Metric interface.

func NewMockMetric added in v1.0.0

func NewMockMetric(ctrl *gomock.Controller) *MockMetric

NewMockMetric creates a new mock instance.

func (*MockMetric) AddCounter added in v1.0.0

func (m *MockMetric) AddCounter(name string, val float64, labels ...string) error

AddCounter mocks base method.

func (*MockMetric) EXPECT added in v1.0.0

func (m *MockMetric) EXPECT() *MockMetricMockRecorder

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

func (*MockMetric) IncCounter added in v1.0.0

func (m *MockMetric) IncCounter(name string, labels ...string) error

IncCounter mocks base method.

func (*MockMetric) ObserveHistogram added in v1.0.0

func (m *MockMetric) ObserveHistogram(name string, val float64, labels ...string) error

ObserveHistogram mocks base method.

func (*MockMetric) ObserveSummary added in v1.0.0

func (m *MockMetric) ObserveSummary(name string, val float64, labels ...string) error

ObserveSummary mocks base method.

func (*MockMetric) SetGauge added in v1.0.0

func (m *MockMetric) SetGauge(name string, val float64, labels ...string) error

SetGauge mocks base method.

type MockMetricMockRecorder added in v1.0.0

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

MockMetricMockRecorder is the mock recorder for MockMetric.

func (*MockMetricMockRecorder) AddCounter added in v1.0.0

func (mr *MockMetricMockRecorder) AddCounter(name, val interface{}, labels ...interface{}) *gomock.Call

AddCounter indicates an expected call of AddCounter.

func (*MockMetricMockRecorder) IncCounter added in v1.0.0

func (mr *MockMetricMockRecorder) IncCounter(name interface{}, labels ...interface{}) *gomock.Call

IncCounter indicates an expected call of IncCounter.

func (*MockMetricMockRecorder) ObserveHistogram added in v1.0.0

func (mr *MockMetricMockRecorder) ObserveHistogram(name, val interface{}, labels ...interface{}) *gomock.Call

ObserveHistogram indicates an expected call of ObserveHistogram.

func (*MockMetricMockRecorder) ObserveSummary added in v1.0.0

func (mr *MockMetricMockRecorder) ObserveSummary(name, val interface{}, labels ...interface{}) *gomock.Call

ObserveSummary indicates an expected call of ObserveSummary.

func (*MockMetricMockRecorder) SetGauge added in v1.0.0

func (mr *MockMetricMockRecorder) SetGauge(name, val interface{}, labels ...interface{}) *gomock.Call

SetGauge indicates an expected call of SetGauge.

Jump to

Keyboard shortcuts

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