Documentation ¶
Overview ¶
Package metrics provides the functionality to create custom metrics for applications
Package metrics is a generated GoMock package.
Index ¶
- func NewCounter(m Metric, name, help string, labels ...string) error
- func NewGauge(m Metric, name, help string, labels ...string) error
- func NewHistogram(m Metric, name, help string, buckets []float64, labels ...string) error
- func NewSummary(m Metric, name, help string, labels ...string) error
- type Metric
- type MockMetric
- func (m *MockMetric) AddCounter(name string, val float64, labels ...string) error
- func (m *MockMetric) EXPECT() *MockMetricMockRecorder
- func (m *MockMetric) IncCounter(name string, labels ...string) error
- func (m *MockMetric) ObserveHistogram(name string, val float64, labels ...string) error
- func (m *MockMetric) ObserveSummary(name string, val float64, labels ...string) error
- func (m *MockMetric) SetGauge(name string, val float64, labels ...string) error
- type MockMetricMockRecorder
- func (mr *MockMetricMockRecorder) AddCounter(name, val interface{}, labels ...interface{}) *gomock.Call
- func (mr *MockMetricMockRecorder) IncCounter(name interface{}, labels ...interface{}) *gomock.Call
- func (mr *MockMetricMockRecorder) ObserveHistogram(name, val interface{}, labels ...interface{}) *gomock.Call
- func (mr *MockMetricMockRecorder) ObserveSummary(name, val interface{}, labels ...interface{}) *gomock.Call
- func (mr *MockMetricMockRecorder) SetGauge(name, val interface{}, labels ...interface{}) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCounter ¶ added in v1.0.0
NewCounter adds new custom counter metric
func NewHistogram ¶ added in v1.0.0
NewHistogram adds new custom Histogram 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
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.
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.