Documentation ¶
Index ¶
- Constants
- func RegisterSystemMetrics(metricsServer TaskMetrics) []error
- func UpdateSystemMetrics(metricsServer TaskMetrics, updateInterval time.Duration)
- type IncrementDecrementHandler
- type MetricDetail
- type MetricHandler
- type MockTaskMetrics
- func (_m *MockTaskMetrics) AppName() string
- func (_m *MockTaskMetrics) DecrementMetric(name string, labels ...string) error
- func (_m *MockTaskMetrics) IncrementMetric(name string, labels ...string) error
- func (_m *MockTaskMetrics) Name() string
- func (_m *MockTaskMetrics) RegisterMetric(name string, help string, labels []string, handler MetricHandler) error
- func (_m *MockTaskMetrics) Start() error
- func (_m *MockTaskMetrics) Stop() error
- func (_m *MockTaskMetrics) UpdateMetric(name string, value float64, labels ...string) error
- type TaskMetrics
Constants ¶
const (
APPNameLabel = "app_name"
)
Variables ¶
This section is empty.
Functions ¶
func RegisterSystemMetrics ¶ added in v0.15.7
func RegisterSystemMetrics(metricsServer TaskMetrics) []error
func UpdateSystemMetrics ¶ added in v0.15.7
func UpdateSystemMetrics(metricsServer TaskMetrics, updateInterval time.Duration)
Types ¶
type IncrementDecrementHandler ¶ added in v0.6.0
type IncrementDecrementHandler interface { MetricHandler Inc(collector prometheus.Collector, labels ...string) error Dec(collector prometheus.Collector, labels ...string) error }
type MetricDetail ¶ added in v0.4.0
type MetricDetail struct { Collector prometheus.Collector Handler MetricHandler }
type MetricHandler ¶ added in v0.4.0
type MockTaskMetrics ¶ added in v0.17.0
MockTaskMetrics is an autogenerated mock type for the TaskMetrics type
func NewMockTaskMetrics ¶ added in v0.17.0
func NewMockTaskMetrics(t mockConstructorTestingTNewMockTaskMetrics) *MockTaskMetrics
NewMockTaskMetrics creates a new instance of MockTaskMetrics. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockTaskMetrics) AppName ¶ added in v0.17.0
func (_m *MockTaskMetrics) AppName() string
AppName provides a mock function with given fields:
func (*MockTaskMetrics) DecrementMetric ¶ added in v0.17.0
func (_m *MockTaskMetrics) DecrementMetric(name string, labels ...string) error
DecrementMetric provides a mock function with given fields: name, labels
func (*MockTaskMetrics) IncrementMetric ¶ added in v0.17.0
func (_m *MockTaskMetrics) IncrementMetric(name string, labels ...string) error
IncrementMetric provides a mock function with given fields: name, labels
func (*MockTaskMetrics) Name ¶ added in v0.17.0
func (_m *MockTaskMetrics) Name() string
Name provides a mock function with given fields:
func (*MockTaskMetrics) RegisterMetric ¶ added in v0.17.0
func (_m *MockTaskMetrics) RegisterMetric(name string, help string, labels []string, handler MetricHandler) error
RegisterMetric provides a mock function with given fields: name, help, labels, handler
func (*MockTaskMetrics) Start ¶ added in v0.17.0
func (_m *MockTaskMetrics) Start() error
Start provides a mock function with given fields:
func (*MockTaskMetrics) Stop ¶ added in v0.17.0
func (_m *MockTaskMetrics) Stop() error
Stop provides a mock function with given fields:
func (*MockTaskMetrics) UpdateMetric ¶ added in v0.17.0
func (_m *MockTaskMetrics) UpdateMetric(name string, value float64, labels ...string) error
UpdateMetric provides a mock function with given fields: name, value, labels
type TaskMetrics ¶ added in v0.3.0
type TaskMetrics interface { Start() error RegisterMetric(name string, help string, labels []string, handler MetricHandler) error UpdateMetric(name string, value float64, labels ...string) error IncrementMetric(name string, labels ...string) error DecrementMetric(name string, labels ...string) error Name() string AppName() string Stop() error }
func NewTaskMetrics ¶ added in v0.3.0
func NewTaskMetrics(path, port, appName string) TaskMetrics