Documentation
¶
Index ¶
- type AbstractExporter
- func (e *AbstractExporter) AddExportCount(n uint64)
- func (e *AbstractExporter) GetClass() string
- func (e *AbstractExporter) GetExportCount() uint64
- func (e *AbstractExporter) GetName() string
- func (e *AbstractExporter) GetStatus() (uint8, string, string)
- func (e *AbstractExporter) InitAbc() error
- func (e *AbstractExporter) SetStatus(code uint8, msg string)
- type Exporter
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractExporter ¶
type AbstractExporter struct { Class string Name string Logger *slog.Logger Status uint8 Message string Options *options.Options Params conf.Exporter Metadata *matrix.Matrix // metadata about the export *sync.Mutex // mutex to block exporter during export // contains filtered or unexported fields }
AbstractExporter implements all methods of the Exporter interface, except Export() It defines attributes that will be "inherited" by child exporters
func New ¶
New creates an AbstractExporter instance with the given arguments: @c - exporter class @n - exporter name @o - poller options @p - exporter parameters
func (*AbstractExporter) AddExportCount ¶
func (e *AbstractExporter) AddExportCount(n uint64)
AddExportCount adds count n to the export counter
func (*AbstractExporter) GetClass ¶
func (e *AbstractExporter) GetClass() string
GetClass returns the class of the AbstractExporter
func (*AbstractExporter) GetExportCount ¶
func (e *AbstractExporter) GetExportCount() uint64
GetExportCount reports and resets count of exported data points "atomically" this and next methods are only to report the poller how much data we have exported (independent of poll/export interval)
func (*AbstractExporter) GetName ¶
func (e *AbstractExporter) GetName() string
GetName returns the name of the AbstractExporter
func (*AbstractExporter) GetStatus ¶
func (e *AbstractExporter) GetStatus() (uint8, string, string)
GetStatus returns current state of exporter
func (*AbstractExporter) InitAbc ¶
func (e *AbstractExporter) InitAbc() error
InitAbc initializes AbstractExporter
func (*AbstractExporter) SetStatus ¶
func (e *AbstractExporter) SetStatus(code uint8, msg string)
SetStatus sets the current state of exporter
type Exporter ¶
type Exporter interface { Init() error // initialize exporter GetClass() string // the class of the exporter, e.g. Prometheus, InfluxDB // GetName is different from Class, since we can have multiple instances of the same Class GetName() string // the name of the exporter instance GetExportCount() uint64 // return and reset number of exported data points, used by Poller to keep stats AddExportCount(uint64) // add count to the export count, called by the exporter itself GetStatus() (uint8, string, string) // return current state of the exporter Export(*matrix.Matrix) (Stats, error) // render data in matrix to the desired format and emit }
Exporter defines the required attributes of an exporter All except, Export() are implemented by AbstractExporter