Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrAlreadyStarted errors.Msg = "observer is already started" ErrUnstartedStop errors.Msg = "cannot stop observer that is not started" )
View Source
const MeterReadingObserverName = "youless.observer.meter"
View Source
const PhaseReadingObserverName = "youless.observer.phase"
View Source
const Version = "0.2.0"
Version of the package and its app.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MeterReadingRegisterer ¶
type MeterReadingRegisterer struct { ExcludePower bool ExcludeS0 bool ExcludeGas bool ExcludeWater bool // contains filtered or unexported fields }
func NewMeterReadingRegisterer ¶
func NewMeterReadingRegisterer(client *youlessclient.Client) *MeterReadingRegisterer
func (*MeterReadingRegisterer) CanRegister ¶ added in v0.2.0
func (reg *MeterReadingRegisterer) CanRegister() bool
func (*MeterReadingRegisterer) Register ¶
func (reg *MeterReadingRegisterer) Register(meter metric.Meter) (Registration, error)
Register registers metrics gauges to the provided meter and starts observing them by getting meter readings from the client.
func (*MeterReadingRegisterer) WithClient ¶
func (reg *MeterReadingRegisterer) WithClient(client *youlessclient.Client) *MeterReadingRegisterer
type Observer ¶
type Observer struct {
// contains filtered or unexported fields
}
func NewObserver ¶
func NewObserver(prov metric.MeterProvider, opts ...Option) (*Observer, error)
func (*Observer) RegisterHealthCheckers ¶
func (o *Observer) RegisterHealthCheckers(registerer healthcheck.Registerer)
type Option ¶
func WithLogger ¶
func WithMeterReading ¶
func WithMeterReading(reg MeterReadingRegisterer, client *youlessclient.Client) Option
func WithPhaseReading ¶
func WithPhaseReading(reg PhaseReadingRegisterer, client *youlessclient.Client) Option
func WithRegisterer ¶
func WithRegisterer(name string, reg Registerer) Option
type PhaseReadingRegisterer ¶
type PhaseReadingRegisterer struct { ExcludePower bool SinglePhase bool // contains filtered or unexported fields }
func NewPhaseReadingRegisterer ¶
func NewPhaseReadingRegisterer(client *youlessclient.Client) *PhaseReadingRegisterer
func (*PhaseReadingRegisterer) CanRegister ¶ added in v0.2.0
func (reg *PhaseReadingRegisterer) CanRegister() bool
func (*PhaseReadingRegisterer) Register ¶
func (reg *PhaseReadingRegisterer) Register(meter metric.Meter) (Registration, error)
Register registers metrics gauges to the provided meter and starts observing them by getting phase readings from the client.
func (*PhaseReadingRegisterer) WithClient ¶
func (reg *PhaseReadingRegisterer) WithClient(client *youlessclient.Client) *PhaseReadingRegisterer
type Registerer ¶
type Registerer interface { CanRegister() bool Register(meter metric.Meter) (Registration, error) }
type Registration ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.