Documentation ¶
Overview ¶
Package metrics is a generated GoMock package.
Index ¶
- func GinHTTPMiddleware(metrics MetricsSvc) gin.HandlerFunc
- type Configuration
- type Metrics
- func (s *Metrics) Capabilities() tally.Capabilities
- func (s *Metrics) Counter(name string) tally.Counter
- func (s *Metrics) CounterWithTags(name string, tags map[string]string) tally.Counter
- func (s *Metrics) Gauge(name string) tally.Gauge
- func (s *Metrics) GaugeWithTags(name string, tags map[string]string) tally.Gauge
- func (s *Metrics) GetRootScope() tally.Scope
- func (s *Metrics) Histogram(name string, buckets tally.Buckets) tally.Histogram
- func (s *Metrics) HistogramWithTags(name string, buckets tally.Buckets, tags map[string]string) tally.Histogram
- func (s *Metrics) SubScope(name string) tally.Scope
- func (s *Metrics) Tagged(tags map[string]string) tally.Scope
- func (s *Metrics) Timer(name string) tally.Timer
- func (s *Metrics) TimerWithTags(name string, tags map[string]string) tally.Timer
- type MetricsSvc
- type MockMetricsSvc
- func (m *MockMetricsSvc) Capabilities() tally.Capabilities
- func (m *MockMetricsSvc) Counter(name string) tally.Counter
- func (m *MockMetricsSvc) CounterWithTags(name string, tags map[string]string) tally.Counter
- func (m *MockMetricsSvc) EXPECT() *MockMetricsSvcMockRecorder
- func (m *MockMetricsSvc) Gauge(name string) tally.Gauge
- func (m *MockMetricsSvc) GaugeWithTags(name string, tags map[string]string) tally.Gauge
- func (m *MockMetricsSvc) GetRootScope() tally.Scope
- func (m *MockMetricsSvc) Histogram(name string, buckets tally.Buckets) tally.Histogram
- func (m *MockMetricsSvc) HistogramWithTags(name string, buckets tally.Buckets, tags map[string]string) tally.Histogram
- func (m *MockMetricsSvc) SubScope(name string) tally.Scope
- func (m *MockMetricsSvc) Tagged(tags map[string]string) tally.Scope
- func (m *MockMetricsSvc) Timer(name string) tally.Timer
- func (m *MockMetricsSvc) TimerWithTags(name string, tags map[string]string) tally.Timer
- type MockMetricsSvcMockRecorder
- func (mr *MockMetricsSvcMockRecorder) Capabilities() *gomock.Call
- func (mr *MockMetricsSvcMockRecorder) Counter(name interface{}) *gomock.Call
- func (mr *MockMetricsSvcMockRecorder) CounterWithTags(name, tags interface{}) *gomock.Call
- func (mr *MockMetricsSvcMockRecorder) Gauge(name interface{}) *gomock.Call
- func (mr *MockMetricsSvcMockRecorder) GaugeWithTags(name, tags interface{}) *gomock.Call
- func (mr *MockMetricsSvcMockRecorder) GetRootScope() *gomock.Call
- func (mr *MockMetricsSvcMockRecorder) Histogram(name, buckets interface{}) *gomock.Call
- func (mr *MockMetricsSvcMockRecorder) HistogramWithTags(name, buckets, tags interface{}) *gomock.Call
- func (mr *MockMetricsSvcMockRecorder) SubScope(name interface{}) *gomock.Call
- func (mr *MockMetricsSvcMockRecorder) Tagged(tags interface{}) *gomock.Call
- func (mr *MockMetricsSvcMockRecorder) Timer(name interface{}) *gomock.Call
- func (mr *MockMetricsSvcMockRecorder) TimerWithTags(name, tags interface{}) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GinHTTPMiddleware ¶
func GinHTTPMiddleware(metrics MetricsSvc) gin.HandlerFunc
Types ¶
type Configuration ¶ added in v1.7.1
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func (*Metrics) Capabilities ¶ added in v1.30.0
func (s *Metrics) Capabilities() tally.Capabilities
func (*Metrics) CounterWithTags ¶
func (*Metrics) GaugeWithTags ¶
func (*Metrics) GetRootScope ¶
func (s *Metrics) GetRootScope() tally.Scope
GetRootScope gets the root scope with the configured base tags
func (*Metrics) HistogramWithTags ¶
type MetricsSvc ¶ added in v1.24.1
type MetricsSvc interface { tally.Scope GetRootScope() tally.Scope Counter(name string) tally.Counter CounterWithTags(name string, tags map[string]string) tally.Counter Gauge(name string) tally.Gauge GaugeWithTags(name string, tags map[string]string) tally.Gauge Timer(name string) tally.Timer TimerWithTags(name string, tags map[string]string) tally.Timer Histogram(name string, buckets tally.Buckets) tally.Histogram HistogramWithTags(name string, buckets tally.Buckets, tags map[string]string) tally.Histogram }
func New ¶
func New(lc fx.Lifecycle, log *zap.SugaredLogger, conf Configuration, app metadata.ApplicationMetadata) MetricsSvc
New creates a metrics service that by defaults serves metrics on :3001/metrics, but is separate from the management endpoints Deprecated: this will be deleted once all apps are on the server module, where metrics will be served on the management port (defaults to the server port unless you change it)
func NewSvc ¶ added in v1.19.1
func NewSvc(lc fx.Lifecycle, app metadata.ApplicationMetadata) MetricsSvc
NewSvc creates an instance of the metrics service but does not start a server for metrics scraping. Serving the open metrics endpoint is handled by a management endpoint, see the management package.
type MockMetricsSvc ¶ added in v1.24.1
type MockMetricsSvc struct {
// contains filtered or unexported fields
}
MockMetricsSvc is a mock of MetricsSvc interface.
func NewMockMetricsSvc ¶ added in v1.24.1
func NewMockMetricsSvc(ctrl *gomock.Controller) *MockMetricsSvc
NewMockMetricsSvc creates a new mock instance.
func (*MockMetricsSvc) Capabilities ¶ added in v1.30.0
func (m *MockMetricsSvc) Capabilities() tally.Capabilities
Capabilities mocks base method.
func (*MockMetricsSvc) Counter ¶ added in v1.24.1
func (m *MockMetricsSvc) Counter(name string) tally.Counter
Counter mocks base method.
func (*MockMetricsSvc) CounterWithTags ¶ added in v1.24.1
CounterWithTags mocks base method.
func (*MockMetricsSvc) EXPECT ¶ added in v1.24.1
func (m *MockMetricsSvc) EXPECT() *MockMetricsSvcMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMetricsSvc) Gauge ¶ added in v1.24.1
func (m *MockMetricsSvc) Gauge(name string) tally.Gauge
Gauge mocks base method.
func (*MockMetricsSvc) GaugeWithTags ¶ added in v1.24.1
GaugeWithTags mocks base method.
func (*MockMetricsSvc) GetRootScope ¶ added in v1.24.5
func (m *MockMetricsSvc) GetRootScope() tally.Scope
GetRootScope mocks base method.
func (*MockMetricsSvc) HistogramWithTags ¶ added in v1.24.1
func (m *MockMetricsSvc) HistogramWithTags(name string, buckets tally.Buckets, tags map[string]string) tally.Histogram
HistogramWithTags mocks base method.
func (*MockMetricsSvc) SubScope ¶ added in v1.30.0
func (m *MockMetricsSvc) SubScope(name string) tally.Scope
SubScope mocks base method.
func (*MockMetricsSvc) Tagged ¶ added in v1.30.0
func (m *MockMetricsSvc) Tagged(tags map[string]string) tally.Scope
Tagged mocks base method.
func (*MockMetricsSvc) Timer ¶ added in v1.24.1
func (m *MockMetricsSvc) Timer(name string) tally.Timer
Timer mocks base method.
func (*MockMetricsSvc) TimerWithTags ¶ added in v1.24.1
TimerWithTags mocks base method.
type MockMetricsSvcMockRecorder ¶ added in v1.24.1
type MockMetricsSvcMockRecorder struct {
// contains filtered or unexported fields
}
MockMetricsSvcMockRecorder is the mock recorder for MockMetricsSvc.
func (*MockMetricsSvcMockRecorder) Capabilities ¶ added in v1.30.0
func (mr *MockMetricsSvcMockRecorder) Capabilities() *gomock.Call
Capabilities indicates an expected call of Capabilities.
func (*MockMetricsSvcMockRecorder) Counter ¶ added in v1.24.1
func (mr *MockMetricsSvcMockRecorder) Counter(name interface{}) *gomock.Call
Counter indicates an expected call of Counter.
func (*MockMetricsSvcMockRecorder) CounterWithTags ¶ added in v1.24.1
func (mr *MockMetricsSvcMockRecorder) CounterWithTags(name, tags interface{}) *gomock.Call
CounterWithTags indicates an expected call of CounterWithTags.
func (*MockMetricsSvcMockRecorder) Gauge ¶ added in v1.24.1
func (mr *MockMetricsSvcMockRecorder) Gauge(name interface{}) *gomock.Call
Gauge indicates an expected call of Gauge.
func (*MockMetricsSvcMockRecorder) GaugeWithTags ¶ added in v1.24.1
func (mr *MockMetricsSvcMockRecorder) GaugeWithTags(name, tags interface{}) *gomock.Call
GaugeWithTags indicates an expected call of GaugeWithTags.
func (*MockMetricsSvcMockRecorder) GetRootScope ¶ added in v1.24.5
func (mr *MockMetricsSvcMockRecorder) GetRootScope() *gomock.Call
GetRootScope indicates an expected call of GetRootScope.
func (*MockMetricsSvcMockRecorder) Histogram ¶ added in v1.24.1
func (mr *MockMetricsSvcMockRecorder) Histogram(name, buckets interface{}) *gomock.Call
Histogram indicates an expected call of Histogram.
func (*MockMetricsSvcMockRecorder) HistogramWithTags ¶ added in v1.24.1
func (mr *MockMetricsSvcMockRecorder) HistogramWithTags(name, buckets, tags interface{}) *gomock.Call
HistogramWithTags indicates an expected call of HistogramWithTags.
func (*MockMetricsSvcMockRecorder) SubScope ¶ added in v1.30.0
func (mr *MockMetricsSvcMockRecorder) SubScope(name interface{}) *gomock.Call
SubScope indicates an expected call of SubScope.
func (*MockMetricsSvcMockRecorder) Tagged ¶ added in v1.30.0
func (mr *MockMetricsSvcMockRecorder) Tagged(tags interface{}) *gomock.Call
Tagged indicates an expected call of Tagged.
func (*MockMetricsSvcMockRecorder) Timer ¶ added in v1.24.1
func (mr *MockMetricsSvcMockRecorder) Timer(name interface{}) *gomock.Call
Timer indicates an expected call of Timer.
func (*MockMetricsSvcMockRecorder) TimerWithTags ¶ added in v1.24.1
func (mr *MockMetricsSvcMockRecorder) TimerWithTags(name, tags interface{}) *gomock.Call
TimerWithTags indicates an expected call of TimerWithTags.