Documentation ¶
Index ¶
- func Main(sc device.SensorConfig)
- type BaseLogger
- type BaseMetricCollector
- func (m *BaseMetricCollector) CreateMetric(name string, valueUnit string, description string) error
- func (m *BaseMetricCollector) IncMetricInt(name string, value int64) error
- func (m *BaseMetricCollector) SetMetricFloat(name string, value float64) error
- func (m *BaseMetricCollector) SetMetricInt(name string, value int64) error
- func (m *BaseMetricCollector) SetMetricString(name string, value string) error
- type BaseMonitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseLogger ¶
type BaseLogger struct {
// contains filtered or unexported fields
}
BaseLogger only logs std info or error.
func (*BaseLogger) Debugf ¶
func (l *BaseLogger) Debugf(format string, args ...interface{})
Debugf logs message only when in debug level.
func (*BaseLogger) Errorf ¶
func (l *BaseLogger) Errorf(format string, args ...interface{})
Errorf logs internal error message.
func (*BaseLogger) Infof ¶
func (l *BaseLogger) Infof(format string, args ...interface{})
Infof logs and records info message.
func (*BaseLogger) Tracef ¶
func (l *BaseLogger) Tracef(format string, args ...interface{})
Tracef logs message only when in trace level.
type BaseMetricCollector ¶
type BaseMetricCollector struct{}
BaseMetricCollector provides a base implementation for metric management.
func (*BaseMetricCollector) CreateMetric ¶
func (m *BaseMetricCollector) CreateMetric(name string, valueUnit string, description string) error
CreateMetric creates a new metric with the specified name, unit, and description.
func (*BaseMetricCollector) IncMetricInt ¶
func (m *BaseMetricCollector) IncMetricInt(name string, value int64) error
IncMetricInt increases the metric value by the specified int64 amount. This method returns nil as there is no default implementation.
func (*BaseMetricCollector) SetMetricFloat ¶
func (m *BaseMetricCollector) SetMetricFloat(name string, value float64) error
SetMetricFloat sets the value of the metric with the specified name to the provided float64 value. This method returns nil as there is no default implementation.
func (*BaseMetricCollector) SetMetricInt ¶
func (m *BaseMetricCollector) SetMetricInt(name string, value int64) error
SetMetricInt sets the value of the metric with the specified name to the provided int64 value. This method returns nil as there is no default implementation.
func (*BaseMetricCollector) SetMetricString ¶
func (m *BaseMetricCollector) SetMetricString(name string, value string) error
SetMetricString sets the value of the metric with the specified name to the provided string value. This method returns nil as there is no default implementation.
type BaseMonitor ¶
type BaseMonitor struct { BaseLogger BaseMetricCollector }
BaseMonitor is a not fully functional monitor for device creation in cmd/Collector.
func NewBaseMonitor ¶
func NewBaseMonitor(logger *log.Entry) *BaseMonitor
NewBaseMonitor returns a new noop monitor for the collector.