Documentation ¶
Index ¶
- type MockCounter
- type MockGauge
- type MockHistogram
- type MockHistogramVec
- func (m *MockHistogramVec) Collect(chan<- prometheus.Metric)
- func (m *MockHistogramVec) Describe(chan<- *prometheus.Desc)
- func (m *MockHistogramVec) LabelsCalled() [][]string
- func (m *MockHistogramVec) Observer() *MockObserver
- func (m *MockHistogramVec) WithLabelValues(lvs ...string) prometheus.Observer
- type MockObserver
- type MockStorageGauge
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockCounter ¶
type MockCounter struct {
// contains filtered or unexported fields
}
nolint: stylecheck // This is unintentionally missing documentation.
func (*MockCounter) Add ¶
func (m *MockCounter) Add(v float64)
nolint: stylecheck // This is unintentionally missing documentation.
func (*MockCounter) Inc ¶
func (m *MockCounter) Inc()
nolint: stylecheck // This is unintentionally missing documentation.
func (*MockCounter) Value ¶
func (m *MockCounter) Value() float64
nolint: stylecheck // This is unintentionally missing documentation.
type MockGauge ¶
type MockGauge struct { Value float64 // contains filtered or unexported fields }
MockGauge is a mock gauge that adheres to prometheus.Gauge for use in unit tests
func (*MockGauge) DecsCalled ¶
DecsCalled gives the number of times Inc() was been called
func (*MockGauge) IncsCalled ¶
IncsCalled gives the number of times Inc() was been called
type MockHistogram ¶
type MockHistogram struct { Values []float64 // contains filtered or unexported fields }
MockHistogram is a mock histogram that adheres to prometheus.Histogram for use in unit tests
func (*MockHistogram) Observe ¶
func (m *MockHistogram) Observe(v float64)
Observe observes a value for the mock histogram
type MockHistogramVec ¶
type MockHistogramVec struct {
// contains filtered or unexported fields
}
MockHistogramVec implements a subset of the prometheus.HistogramVec interface.
func NewMockHistogramVec ¶
func NewMockHistogramVec() *MockHistogramVec
NewMockHistogramVec returns a new MockHistogramVec.
func (*MockHistogramVec) Collect ¶
func (m *MockHistogramVec) Collect(chan<- prometheus.Metric)
Collect does nothing.
func (*MockHistogramVec) Describe ¶
func (m *MockHistogramVec) Describe(chan<- *prometheus.Desc)
Describe does nothing.
func (*MockHistogramVec) LabelsCalled ¶
func (m *MockHistogramVec) LabelsCalled() [][]string
LabelsCalled returns the set of labels which have been observed.
func (*MockHistogramVec) Observer ¶
func (m *MockHistogramVec) Observer() *MockObserver
Observer returns the mocked observer.
func (*MockHistogramVec) WithLabelValues ¶
func (m *MockHistogramVec) WithLabelValues(lvs ...string) prometheus.Observer
WithLabelValues records the given labels such that `LabelsCalled()` will return the set of observed labels.
type MockObserver ¶
type MockObserver struct {
// contains filtered or unexported fields
}
MockObserver implements a subset of the prometheus.Observer interface.
func (*MockObserver) Observe ¶
func (m *MockObserver) Observe(v float64)
Observe records the given value in its observed values.
func (*MockObserver) Observed ¶
func (m *MockObserver) Observed() []float64
Observed returns all observed values.
type MockStorageGauge ¶
type MockStorageGauge struct {
*MockGauge
}
MockStorageGauge wraps a MockGauge
func (*MockStorageGauge) Dec ¶
func (m *MockStorageGauge) Dec(_, _ string)
Dec will track total calls to this method while ignoring params
func (*MockStorageGauge) Inc ¶
func (m *MockStorageGauge) Inc(_, _ string)
Inc will track total calls to this method while ignoring params